giacomocavalieri / birdie

🐦‍⬛ Snapshot testing in Gleam
https://hexdocs.pm/birdie/
Apache License 2.0
81 stars 6 forks source link

Windows support #18

Closed ollema closed 1 week ago

ollema commented 2 weeks ago

Hi!

I am using birdie in my syntax highlighting package and it works great locally and in CI for unix.

But there seems to be some problems reading the snapshots themselves for windows: https://github.com/ollema/glans/actions/runs/10596507645/job/29364734995

In short:

  1) glans_test.bash_syntax_highlighting_test
     #{function => <<"snap">>,line => 110,
       message =>
           <<"Birdie snapshot test failed\nIt looks like \e[3m\"./birdie_snapshots/test_bash_syntax_highlighting.accepted\"\n\e[23mis not a valid snapshot.\nThis might happen when someone modifies its content.\nTry deleting the snapshot and recreating it.">>,
       module => <<"birdie">>,gleam_error => panic}
     location: birdie.snap:110
     stacktrace:
       birdie.snap
     output: 

I'm afraid I don't have much insight here into what the correct approach forward here is since I am not a windows user.

Let me know if you want me to provide additional details!

giacomocavalieri commented 2 weeks ago

Thank you for the bug report! I'm on holiday for a couple of days, I'll look into it more thoroughly later this week :)

giacomocavalieri commented 1 week ago

Took me long enough but I managed to fix this on https://github.com/giacomocavalieri/birdie/commit/cd35de34bba2056d4c55272e7dd3d916c126e7c2!

This was due to birdie not handling well \r\n in snapshot files, and the reason this only happened on Windows 😁 Now everything should work fine, thanks for the patience!