haltcase / glob

Pure Nim library for matching file paths against Unix style glob patterns.
https://glob.bolingen.me
MIT License
61 stars 5 forks source link

walkGlob returns paths with `/` instead of `\` on windows #46

Closed timotheecour closed 4 years ago

timotheecour commented 4 years ago

this test seems weird on windows:

      check seqsEqual(toSeq(walkGlob("temp")), @[
        p"temp/deep/dir/file.nim",
        p"temp/not_as/deep.jpg",
        p"temp/not_as/deep.nim",
        p"temp/shallow.nim"
      ])

shouldn't it return paths with \ on windows (like os.walkDirRec etc) ?

likewise with other tests on windows

haltcase commented 4 years ago

@timotheecour took me a bit to remember how I wrote the tests :laughing:

This template is used as a string literal prefix for all the test cases and splits on /, then uses os.joinPath to stitch the parts back up with the correct OS directory separator:

https://github.com/citycide/glob/blob/e126bc92b53668fa41215407087b48e422c62b8a/tests.nim#L21-L22

timotheecour commented 4 years ago

ohhh i c....