test: fix preview_nul

This commit is contained in:
Loric ANDRE 2026-01-19 22:59:48 +01:00
parent 9d486b78fa
commit 102f7c79f2
2 changed files with 10 additions and 1 deletions

View file

@ -20,6 +20,15 @@ sk_test!(issue_361_literal_space_invert, "foo bar\\nfoo bar", &["-q", "'!foo\\
@capture[2] eq("> foo bar");
});
sk_test!(issue_547_null_match, "\\0Test Test Test", &[], {
@capture[0] starts_with(">");
@keys Str("Test");
@capture[0] starts_with("> Test");
@capture[2] starts_with("> Test Test Test");
@capture_colored[2] trim().eq("\u{1b}[38;5;161m>\u{1b}[38;5;168m \u{1b}[38;5;151m\u{1b}[48;5;236mTest\u{1b}[38;5;254m Test Test");
});
sk_test!(issue_xxx_null_delimiter_with_nth, "a\\0b\\0c", &["--delimiter", "'\\x00'", "--with-nth", "2"], {
@capture[0] starts_with(">");
@capture[2] starts_with("> b");

View file

@ -8,7 +8,7 @@ sk_test!(preview_preserve_quotes, @cmd "echo \"'\\\"ABC\\\"'\"", &["--preview",
@capture[*] contains("X'\"ABC\"'X");
});
sk_test!(preview_nul_char, @cmd "echo -ne 'a\\0b'", &["--preview", "'echo -en \"{}\" | hexdump -C'"], {
sk_test!(preview_nul_char, @cmd "echo -ne 'a\\0b'", &["--preview", "'echo -en \"{..}\" | hexdump -C'"], {
@capture[0] starts_with(">");
@capture[*] contains("61 00 62");
});