Skip to content

Tags: Mic92/nix-diff-rs

Tags

assets

Toggle assets's commit message
tests: add inline-highlight snapshot with readable ANSI tokens

The previous test only checked that \x1b[7m appeared somewhere in the
output. A snapshot with escapes rendered as <rev>/<red>/etc. tokens
lets us review exactly which segments get highlighted and catch
regressions like whole-line highlighting or missed tokens.

While writing the snapshot, it revealed that adjacent emphasized
tokens each got their own REVERSE/NOREVERSE pair, producing
"<rev>v2</rev><rev> </rev><rev>with</rev>..." instead of
"<rev>v2 with improvements</rev>". Coalesce by tracking reverse-video
state and only toggling on transitions.