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 d1793d7 commit 81932f7
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 @@ -65,6 +65,7 @@ const schemaDefs = {
MadeUp: {
columns: {
onset: 'required',
strain_rrid: 'optional',
},
},
},
Expand Down Expand Up @@ -165,4 +166,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 81932f7

Please sign in to comment.