summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLawrence Chou <lawrencechou1024@gmail.com>2018-10-14 22:22:59 +0800
committerDavid Peter <sharkdp@users.noreply.github.com>2018-10-19 21:04:46 +0200
commitafc5aacb28563bbe0019a922d536660a14279da6 (patch)
tree37e8126fedbc9a384651b6044aefaf327ff7fd04 /tests
parent30b742e9845314bcac67f37664cfb3df61c1ba3f (diff)
Move tabs_* snapshot tests to integration_tests
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests.rs37
-rw-r--r--tests/snapshot_tests.rs6
2 files changed, 37 insertions, 6 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 23acf3fc..c1af27fc 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -1,7 +1,10 @@
extern crate assert_cmd;
+mod tester;
+
use assert_cmd::prelude::*;
use std::process::Command;
+use tester::BatTester;
fn bat() -> Command {
let mut cmd = Command::main_binary().unwrap();
@@ -12,6 +15,10 @@ fn bat() -> Command {
cmd
}
+fn tester() -> BatTester {
+ BatTester::new()
+}
+
#[test]
fn basic() {
bat()
@@ -97,6 +104,36 @@ fn line_range_last_3() {
}
#[test]
+fn tabs_passthrough_wrapped() {
+ tester().test_snapshot("tabs_passthrough_wrapped", "full", 0, true);
+}
+
+#[test]
+fn tabs_4_wrapped() {
+ tester().test_snapshot("tabs_4_wrapped", "full", 4, true);
+}
+
+#[test]
+fn tabs_8_wrapped() {
+ tester().test_snapshot("tabs_8_wrapped", "full", 8, true);
+}
+
+#[test]
+fn tabs_passthrough() {
+ tester().test_snapshot("tabs_passthrough", "full", 0, false);
+}
+
+#[test]
+fn tabs_4() {
+ tester().test_snapshot("tabs_4", "full", 4, false);
+}
+
+#[test]
+fn tabs_8() {
+ tester().test_snapshot("tabs_8", "full", 8, false);
+}
+
+#[test]
fn fail_non_existing() {
bat().arg("non-existing-file").assert().failure();
}
diff --git a/tests/snapshot_tests.rs b/tests/snapshot_tests.rs
index 6e76c8b5..609f19c5 100644
--- a/tests/snapshot_tests.rs
+++ b/tests/snapshot_tests.rs
@@ -32,10 +32,4 @@ snapshot_tests! {
changes_grid_header_numbers: "changes,grid,header,numbers" => [wrap: false, tabs: 8],
full: "full" => [wrap: false, tabs: 8],
plain: "plain" => [wrap: false, tabs: 0],
- tabs_passthrough_wrapped: "full" => [wrap: true, tabs: 0],
- tabs_4_wrapped: "full" => [wrap: true, tabs: 4],
- tabs_8_wrapped: "full" => [wrap: true, tabs: 8],
- tabs_passthrough: "full" => [wrap: false, tabs: 0],
- tabs_4: "full" => [wrap: false, tabs: 4],
- tabs_8: "full" => [wrap: false, tabs: 8],
}