summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEthan P <eth-p+git@hidden.email>2023-04-17 15:52:17 -0700
committerEthan P. <eth-p+git@hidden.email>2024-02-09 22:09:39 -0800
commit3d04699710540840b36ab964a7bce3597322fa88 (patch)
treed5944fa822e309602ff209c174602d9674108eae /tests
parent054421268fff33003b892eb7bcef1a831c6c308d (diff)
Add regression test for #2541
More specifically, the test ensures that OSC sequences don't end up wrapping the line.
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/regression_tests/issue_2541.txt1
-rw-r--r--tests/integration_tests.rs14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/examples/regression_tests/issue_2541.txt b/tests/examples/regression_tests/issue_2541.txt
new file mode 100644
index 00000000..1059b94e
--- /dev/null
+++ b/tests/examples/regression_tests/issue_2541.txt
@@ -0,0 +1 @@
+]8;;http://example.com\This is a link]8;;\n \ No newline at end of file
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 437ae8e7..3b8bdf7f 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -1163,6 +1163,20 @@ fn bom_stripped_when_no_color_and_not_loop_through() {
);
}
+// Regression test for https://github.com/sharkdp/bat/issues/2541
+#[test]
+fn no_broken_osc_emit_with_line_wrapping() {
+ bat()
+ .arg("--color=always")
+ .arg("--decorations=never")
+ .arg("--wrap=character")
+ .arg("--terminal-width=40")
+ .arg("regression_tests/issue_2541.txt")
+ .assert()
+ .success()
+ .stdout(predicate::function(|s: &str| s.lines().count() == 1));
+}
+
#[test]
fn can_print_file_named_cache() {
bat_with_config()