yeslogic / fathom

🚧 (Alpha stage software) A declarative data definition language for formally specifying binary data formats. 🚧
Apache License 2.0
259 stars 14 forks source link

Snapshot verification fails on Windows #326

Open wezm opened 2 years ago

wezm commented 2 years ago
---- tests\fail\elaboration\unification\mismatch\arrow-both.fathom ----

    snapshot mismatch:
        ---- path ----
        tests\fail\elaboration\unification\mismatch\arrow-both.snap
        ---- stderr diff ----
         2| -   ┌─ tests/fail/elaboration/unification/mismatch/arrow-both.fathom:3:34
         2| +   ┌─ tests\fail\elaboration\unification\mismatch\arrow-both.fathom:3:34
         8| -   ┌─ tests/fail/elaboration/unification/mismatch/arrow-both.fathom:3:39
         8| +   ┌─ tests\fail\elaboration\unification\mismatch\arrow-both.fathom:3:39

    failures:
        snapshot mismatch

Paths in errors use the native format, thus Windows ones do not match.

brendanzab commented 2 years ago

Hmm, I wonder how other compilers handle this in their tests. 🤔

wezm commented 2 years ago

rustc tests appear to assume unix-style paths and line endings:

https://github.com/rust-lang/rust/blob/master/src/test/ui/module-macro_use-arguments.stderr

and are normalised as such in the test runner:

https://github.com/rust-lang/rust/blob/44628f7273052d0bb8e8218518dacab210e1fe0d/src/tools/compiletest/src/runtest.rs#L3595-L3620

brendanzab commented 2 years ago

Oh cool! I was looking in compiletest but missed this!