Skip to content

Commit 5ec7863

Browse files
committed
test: Verify pseudo-age deprecation
1 parent d2e0025 commit 5ec7863

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/schema/tables.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,25 @@ Deno.test('tables eval* tests', async (t) => {
166166
assertEquals(issues[0].issueMessage, "'f'")
167167
})
168168

169+
await t.step('verify pseudo-age deprecation', () => {
170+
const context = {
171+
path: '/participants.tsv',
172+
extension: '.tsv',
173+
sidecar: {},
174+
columns: {
175+
participant_id: ['sub-01', 'sub-02', 'sub-03'],
176+
age: ['10', '89+', '89+'],
177+
},
178+
dataset: { issues: new DatasetIssues() },
179+
}
180+
const rule = schemaDefs.rules.tabular_data.modality_agnostic.Participants
181+
evalColumns(rule, context, schema, 'rules.tabular_data.modality_agnostic.Participants')
182+
183+
// age gets a warning
184+
let issues = context.dataset.issues.get({ code: 'TSV_PSEUDO_AGE_DEPRECATED' })
185+
assertEquals(issues.length, 1)
186+
})
187+
169188
await t.step('verify column ordering', () => {
170189
const context = {
171190
path: '/sub-01/sub-01_scans.tsv',

0 commit comments

Comments
 (0)