summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-11-01 21:35:35 +0100
committersharkdp <davidpeter@web.de>2020-11-01 21:35:35 +0100
commit66f8508b575a9ce924a30fda6803fb4e5338fb3a (patch)
treebc8a16808995e5a53e31c65eb97ba4d627ac5917
parentafb249e854d87045e812f4bc7116d150376f782a (diff)
Add stdin test
-rw-r--r--tests/integration_tests.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 58bf645..2633e01 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -21,6 +21,20 @@ fn can_print_simple_ascii_file() {
}
#[test]
+fn can_read_input_from_stdin() {
+ hexyl()
+ .arg("--color=never")
+ .write_stdin("abc")
+ .assert()
+ .success()
+ .stdout(
+ "┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
+ │00000000│ 61 62 63 ┊ │abc ┊ │\n\
+ └────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
+ );
+}
+
+#[test]
fn fails_on_non_existing_input() {
hexyl().arg("non-existing").assert().failure();
}