Newline gets escaped in assert_snapshot
if the string contains '\t'
#715
Labels
bug
Something isn't working
assert_snapshot
if the string contains '\t'
#715
What happened?
#713 changes the behaviour of
assert_snapshot
so that whenever there are control characters in the string, it gets printed usingformat!
which will instead of literally.When the string contains just
\n
and\t
, this makes the diff less readable:This could be fixed by treating
\t
as\n
inhas_control_chars
:https://github.com/mitsuhiko/insta/pull/713/files#diff-2666420e8389f1d842ce108018b05f3f68fa4b920f8c1793a3d4d01f21443544R696-R698
Personally I would go even further and prefer the old handling for
\x1b
(used for ANSI escape codes) as well.Here's the diff for applying insta 1.42.1 on jj jakobhellermann/jj@7fdb978 and in my opinion it is much less readable.
Reproduction steps
No response
Insta Version
1.42.1
rustc Version
rustc 1.85.0-nightly (45d11e51b 2025-01-01)
What did you expect?
No response
The text was updated successfully, but these errors were encountered: