File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 11import { assertEquals } from '@std/assert'
2+ import { SEPARATOR_PATTERN } from '@std/path'
23import { BIDSContext } from '../schema/context.ts'
34import { _findRuleMatches , datatypeFromDirectory , hasMatch } from './filenameIdentify.ts'
45import { BIDSFileDeno } from '../files/deno.ts'
@@ -67,12 +68,8 @@ Deno.test('test hasMatch', async (t) => {
6768
6869 await t . step ( 'No match' , async ( ) => {
6970 const tmpFile = Deno . makeTempFileSync ( )
70- const parts = tmpFile . split ( '/' )
71- const file = new BIDSFileDeno (
72- parts . slice ( 0 , parts . length - 1 ) . join ( '/' ) ,
73- '/' + parts [ parts . length - 1 ] ,
74- ignore ,
75- )
71+ const [ dir , base ] = tmpFile . split ( SEPARATOR_PATTERN )
72+ const file = new BIDSFileDeno ( dir , `/${ base } ` , ignore )
7673
7774 const context = new BIDSContext ( file )
7875 await hasMatch ( schema , context )
@@ -82,7 +79,6 @@ Deno.test('test hasMatch', async (t) => {
8279 code : 'NOT_INCLUDED' ,
8380 } ) . length ,
8481 1 ,
85- `${ context . file . path } ${ tmpFile } `
8682 )
8783 Deno . removeSync ( tmpFile )
8884 } )
You can’t perform that action at this time.
0 commit comments