Skip to content

Commit e2568c0

Browse files
committed
test: Verify target entities do not trigger exact match logic
1 parent bfa601e commit e2568c0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/files/inheritance.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,22 @@ Deno.test('walkback inheritance tests', async (t) => {
7272
assertEquals(rootElectrodes.path, '/space-talairach_electrodes.tsv')
7373
},
7474
)
75+
await t.step(
76+
'The presence of target entities does not trigger exact match logic',
77+
async () => {
78+
const rootFileTree = pathsToTree([
79+
'/sub-01/ieeg/sub-01_task-rest_ieeg.edf',
80+
'/sub-01/ieeg/sub-01_task-rest_space-anat_electrodes.tsv',
81+
'/sub-01/ieeg/sub-01_task-rest_space-MNI_electrodes.tsv',
82+
])
83+
const dataFile = rootFileTree.get('sub-01/ieeg/sub-01_task-rest_ieeg.edf') as BIDSFile
84+
const electrodes = walkBack(dataFile, true, ['.tsv'], 'electrodes', ['space'])
85+
const localElectrodes: BIDSFile[] = electrodes.next().value
86+
assert(Array.isArray(localElectrodes))
87+
assertEquals(localElectrodes.map((f) => f.path), [
88+
'/sub-01/ieeg/sub-01_task-rest_space-anat_electrodes.tsv',
89+
'/sub-01/ieeg/sub-01_task-rest_space-MNI_electrodes.tsv',
90+
])
91+
},
92+
)
7593
})

0 commit comments

Comments
 (0)