Skip to content

Commit 1963166

Browse files
committed
add basic test for glob patterns
1 parent 79b6466 commit 1963166

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/issues/datasetIssues.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ Deno.test('DatasetIssues management class', async (t) => {
2525
assertEquals(foundIssue[0].code, 'TEST_FILES_ERROR')
2626
})
2727

28+
await t.step('get issues with glob pattern', () => {
29+
const issues = new DatasetIssues()
30+
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mprage_T1w.json' })
31+
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-memprage_T1w.json' })
32+
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mb1_bold.json' })
33+
issues.add({ code: 'TEST_FILES_ERROR', location: '/acq-mb4_bold.json' })
34+
const foundIssue = issues.get({ location: '*_bold.json' })
35+
assertEquals(foundIssue.length, 2)
36+
})
37+
2838
await t.step('test groupBy', () => {
2939
const issues = new DatasetIssues()
3040
issues.add({ code: 'NOT_INCLUDED', location: '/file_1' })

0 commit comments

Comments
 (0)