1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 08:42:08 +00:00

Limit overstrike stripping to man pages and help

This commit is contained in:
Alex Kirk
2025-12-11 05:45:44 +01:00
parent 59c5896902
commit de414ed631
2 changed files with 27 additions and 9 deletions

View File

@@ -2556,7 +2556,7 @@ fn no_strip_overstrike_for_plain_text() {
#[test]
fn strip_overstrike_with_syntax_highlighting() {
// Overstrike is stripped when syntax highlighting is applied (e.g., for help)
// Overstrike is stripped for certain syntax highlighting like command help.
bat()
.arg("--force-colorization")
.arg("--language=help")
@@ -2581,6 +2581,19 @@ fn strip_overstrike_for_manpage_syntax() {
.stderr("");
}
#[test]
fn no_strip_overstrike_for_other_syntax() {
// Overstrike is NOT stripped for other syntaxes (e.g., Rust)
bat()
.arg("--force-colorization")
.arg("--language=rust")
.arg("overstrike.txt")
.assert()
.success()
.stdout(predicate::str::contains("\x08"))
.stderr("");
}
#[test]
fn show_all_shows_backspace_with_caret_notation() {
// --show-all should display backspace characters (not strip them)