ANSI sequences modified unexpectedly

In a specification source code, I use ANSI sequences to surround certain values in order to check if they are rendered correctly. Several months ago (March 2025), when I wrote this code, the specifications worked correctly.
Today, they fail (Crystal 1.19.1) and I noticed something strange:
in the displayed failures, the sequence \e[0m in my source code (the “expected” value) is replaced by the sequence \e[22m (the “obtained” value), which of course produces an error.
I don’t understand why!
Any ideas?

Can you share a runnable example of how it’s not working now but did work previously?

This is probably related to Use proper ANSI reset codes in `Colorize` by Blacksmoke16 · Pull Request #16052 · crystal-lang/crystal · GitHub. Possibly a bug, but hard to say without seeing an actual example.

That’s was the reason. Fixed
Thanks

Ahh that makes more sense :sweat_smile:. My brain didn’t interpret specifications as specs/tests. But glad it was an easy fix :slight_smile: