Skip to content

Commit

Permalink
test(tsv): Verify that n/a is permitted in both types of columns
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jul 29, 2024
1 parent 4d2c3c6 commit 15bcac8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bids-validator/src/schema/applyRules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const schemaDefs = {
MadeUp: {
columns: {
onset: 'required',
strain_rrid: 'optional',
},
},
},
Expand Down Expand Up @@ -166,4 +167,20 @@ Deno.test('evalColumns tests', async (t) => {
evalColumns(rule, context, schema, 'rules.tabular_data.made_up.MadeUp')
assert(context.issues.hasIssue({ key: 'TSV_VALUE_INCORRECT_TYPE' }))
})

await t.step('verify n/a is allowed', () => {
const context = {
path: '/sub-01/sub-01_something.tsv',
extension: '.tsv',
sidecar: {},
columns: {
onset: ['1', '2', 'n/a'],
strain_rrid: ['RRID:SCR_012345', 'RRID:SCR_012345', 'n/a'],
},
issues: new DatasetIssues(),
}
const rule = schemaDefs.rules.tabular_data.made_up.MadeUp
evalColumns(rule, context, schema, 'rules.tabular_data.made_up.MadeUp')
assert(context.issues.size === 0)
})
})

0 comments on commit 15bcac8

Please sign in to comment.