Skip to content

Commit 452c020

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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/files/inheritance.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,24 @@ 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 entitites 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+
const rootElectrodes: BIDSFile = electrodes.next().value
92+
assertEquals(rootElectrodes.path, '/space-talairach_electrodes.tsv')
93+
},
94+
)
7595
})

0 commit comments

Comments
 (0)