mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Add stdin test
This commit is contained in:
1 parent
afb249e854
commit
66f8508b57
1 file changed
+14
@@ -20,6 +20,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();
|
||||
|
||||
Reference in new issue
Block a user