Skip to content

Commit

Permalink
Add additional test for repeated placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
happy5214 committed Jul 26, 2024
1 parent 7a53335 commit 6905aa2
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tests/event.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1540,10 +1540,10 @@ describe('HED string and event validation', () => {
withUnit: 'Time-value/# ms',
child: 'Left-side-of/#',
extensionAllowed: 'Human/Driver/#',
invalidParent: 'Event/Nonsense/#',
extensionParent: 'Item/TestDef1/#',
missingRequiredUnit: 'Time-value/#',
wrongLocation: 'Item/#/OtherItem',
duplicatePlaceholder: 'Item/#/#',
}
const expectedIssues = {
takesValue: [],
Expand All @@ -1554,12 +1554,6 @@ describe('HED string and event validation', () => {
tag: testStrings.extensionAllowed,
}),
],
invalidParent: [
generateIssue('invalidExtension', {
tag: 'Nonsense',
parentTag: 'Event',
}),
],
extensionParent: [
generateIssue('invalidPlaceholder', {
tag: testStrings.extensionParent,
Expand All @@ -1571,6 +1565,20 @@ describe('HED string and event validation', () => {
tag: testStrings.wrongLocation,
}),
],
duplicatePlaceholder: [
generateIssue('invalidPlaceholder', {
tag: testStrings.duplicatePlaceholder,
}),
generateIssue('invalidPlaceholder', {
tag: testStrings.duplicatePlaceholder,
}),
generateIssue('invalidPlaceholder', {
tag: testStrings.duplicatePlaceholder,
}),
generateIssue('invalidTag', {
tag: testStrings.duplicatePlaceholder,
}),
],
}
return validatorSemantic(testStrings, expectedIssues, true)
})
Expand Down

0 comments on commit 6905aa2

Please sign in to comment.