Skip to content

Commit

Permalink
Delete last two skipped tests (in HED utility tests)
Browse files Browse the repository at this point in the history
These appeared to be HED 2-specific, and with HED 2 being removed
from the code, they were no longer relevant.

Fixes #136
  • Loading branch information
happy5214 committed Jan 23, 2025
1 parent 54f20b3 commit 1bab5bd
Showing 1 changed file with 0 additions and 106 deletions.
106 changes: 0 additions & 106 deletions tests/utils/hed.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,111 +111,5 @@ describe('HED tag string utility functions', () => {
return hed.removeGroupParentheses(string)
})
})

it.skip('should properly determine valid values', () => {
const testStrings = {
integer: '4',
decimal: '21.2',
scientific: '3.4e2',
negative: '-9.5e-1',
placeholder: '#',
time: '22:45',
name: 'abc',
word: 'one',
space: 'spaced out',
}
const expectedResultsHed2 = {
integer: true,
decimal: true,
scientific: true,
negative: true,
placeholder: true,
time: true,
name: true,
word: true,
space: true,
}
const expectedResultsHed2Numeric = {
integer: true,
decimal: true,
scientific: true,
negative: true,
placeholder: true,
time: false,
name: false,
word: false,
space: false,
}
const expectedResultsHed3 = {
integer: true,
decimal: true,
scientific: true,
negative: true,
placeholder: true,
time: false,
name: true,
word: true,
space: true,
}
const expectedResultsHed3Numeric = {
integer: true,
decimal: true,
scientific: true,
negative: true,
placeholder: true,
time: false,
name: false,
word: false,
space: false,
}
validator(testStrings, expectedResultsHed2, (string) => {
return hed.validateValue(string, false, false)
})
validator(testStrings, expectedResultsHed2Numeric, (string) => {
return hed.validateValue(string, true, false)
})
validator(testStrings, expectedResultsHed3, (string) => {
return hed.validateValue(string, false, true)
})
validator(testStrings, expectedResultsHed3Numeric, (string) => {
return hed.validateValue(string, true, true)
})
})
})

describe('HED tag schema-based utility functions', () => {
const localHedSchemaFile = 'tests/data/HED7.1.1.xml'
let hedSchemas

beforeAll(async () => {
const spec1 = new SchemaSpec('', '7.1.1', '', localHedSchemaFile)
const specs = new SchemasSpec().addSchemaSpec(spec1)
hedSchemas = await buildSchemas(specs)
})

it.skip('should strip valid units from a value', () => {
const dollarsString = '$25.99'
const volumeString = '100 m^3'
const prefixedVolumeString = '100 cm^3'
const invalidVolumeString = '200 cm'
const currencyUnits = ['dollars', '$', 'points', 'fraction']
const volumeUnits = ['m^3']
const strippedDollarsString = hed.validateUnits(dollarsString, currencyUnits, hedSchemas.baseSchema.attributes)
const strippedVolumeString = hed.validateUnits(volumeString, volumeUnits, hedSchemas.baseSchema.attributes)
const strippedPrefixedVolumeString = hed.validateUnits(
prefixedVolumeString,
volumeUnits,
hedSchemas.baseSchema.attributes,
)
const strippedInvalidVolumeString = hed.validateUnits(
invalidVolumeString,
volumeUnits,
hedSchemas.baseSchema.attributes,
)
assert.sameOrderedMembers(strippedDollarsString, [true, true, '25.99'])
assert.sameOrderedMembers(strippedVolumeString, [true, true, '100'])
assert.sameOrderedMembers(strippedPrefixedVolumeString, [true, true, '100'])
assert.sameOrderedMembers(strippedInvalidVolumeString, [true, false, '200'])
})
})
})

0 comments on commit 1bab5bd

Please sign in to comment.