@@ -1,7 +1,10 @@
11extern crate assert_cmd;
22
3+mod tester;
4+
35use assert_cmd::prelude::*;
46use std::process::Command;
7+use tester::BatTester;
58
69fn bat() -> Command {
710 let mut cmd = Command::main_binary().unwrap();
@@ -12,6 +15,10 @@ fn bat() -> Command {
1215 cmd
1316}
1417
18+fn tester() -> BatTester {
19+ BatTester::new()
20+}
21+
1522#[test]
1623fn basic() {
1724 bat()
@@ -96,6 +103,36 @@ fn line_range_last_3() {
96103 .stdout("line 2\nline 3\nline 4\n");
97104}
98105
106+#[test]
107+fn tabs_passthrough_wrapped() {
108+ tester().test_snapshot("tabs_passthrough_wrapped", "full", 0, true);
109+}
110+
111+#[test]
112+fn tabs_4_wrapped() {
113+ tester().test_snapshot("tabs_4_wrapped", "full", 4, true);
114+}
115+
116+#[test]
117+fn tabs_8_wrapped() {
118+ tester().test_snapshot("tabs_8_wrapped", "full", 8, true);
119+}
120+
121+#[test]
122+fn tabs_passthrough() {
123+ tester().test_snapshot("tabs_passthrough", "full", 0, false);
124+}
125+
126+#[test]
127+fn tabs_4() {
128+ tester().test_snapshot("tabs_4", "full", 4, false);
129+}
130+
131+#[test]
132+fn tabs_8() {
133+ tester().test_snapshot("tabs_8", "full", 8, false);
134+}
135+
99136#[test]
100137fn fail_non_existing() {
101138 bat().arg("non-existing-file").assert().failure();