From 3a75d85b80a9caacb2e0045b418ebc8b506db301 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 31 Aug 2019 12:46:03 +0200 Subject: [PATCH] Add test for 'snip' feature --- tests/integration_tests.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index ec1ffd3f..ac4e3d81 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -463,3 +463,22 @@ fn can_print_file_named_cache() { fn does_not_print_unwanted_file_named_cache() { bat_with_config().arg("cach").assert().failure(); } + +#[test] +fn snip() { + bat() + .arg("multiline.txt") + .arg("--style=numbers,snip") + .arg("--decorations=always") + .arg("--line-range=1:2") + .arg("--line-range=4:") + .assert() + .success() + .stdout( + " 1 line 1 + 2 line 2 + ...─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 8< ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ + 4 line 4 +", + ); +}