Skip to content

Commit

Permalink
add basic test for glob patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Jan 6, 2025
1 parent 79b6466 commit 9bbac82
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/issues/datasetIssues.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Deno.test('DatasetIssues management class', async (t) => {
assertEquals(foundIssue[0].code, 'TEST_FILES_ERROR')
})

await t.step('get issues with glob pattern', () => {
const issues = new DatasetIssues()
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mprage_T1w.json' }, 'Test issue')
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-memprage_T1w.json' }, 'Test issue')
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mb1_bold.json' }, 'Test issue')
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mb4_bold.json' }, 'Test issue')
const foundIssue = issues.get({ location: '*_bold.json' })
assertEquals(foundIssue.length, 2)
})

await t.step('test groupBy', () => {
const issues = new DatasetIssues()
issues.add({ code: 'NOT_INCLUDED', location: '/file_1' })
Expand Down

0 comments on commit 9bbac82

Please sign in to comment.