mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-19 04:21:06 +00:00
Tests ~ add predicate normalization for tests using echo
This commit is contained in:
parent
71ab4a2058
commit
4840c7cd78
@ -76,6 +76,7 @@ default-features = false
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
assert_cmd = "1.0.1"
|
assert_cmd = "1.0.1"
|
||||||
|
predicates = "1.0.4"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = { version = "2.33", optional = true }
|
clap = { version = "2.33", optional = true }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use assert_cmd::Command;
|
use assert_cmd::Command;
|
||||||
|
use predicates::{prelude::predicate,str::PredicateStrExt};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
|
|
||||||
@ -454,7 +455,7 @@ fn pager_basic() {
|
|||||||
println!("stdout={:#?}", stdout);
|
println!("stdout={:#?}", stdout);
|
||||||
assert
|
assert
|
||||||
.success()
|
.success()
|
||||||
.stdout("pager-output\n");
|
.stdout(predicate::eq("pager-output\n").normalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -469,7 +470,7 @@ fn pager_overwrite() {
|
|||||||
println!("stdout={:#?}", stdout);
|
println!("stdout={:#?}", stdout);
|
||||||
assert
|
assert
|
||||||
.success()
|
.success()
|
||||||
.stdout("pager-output\n");
|
.stdout(predicate::eq("pager-output\n").normalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -484,7 +485,7 @@ fn pager_disable() {
|
|||||||
println!("stdout={:#?}", stdout);
|
println!("stdout={:#?}", stdout);
|
||||||
assert
|
assert
|
||||||
.success()
|
.success()
|
||||||
.stdout("hello world\n");
|
.stdout(predicate::eq("hello world\n").normalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -510,7 +511,7 @@ fn config_read_arguments_from_file() {
|
|||||||
println!("stdout={:#?}", stdout);
|
println!("stdout={:#?}", stdout);
|
||||||
assert
|
assert
|
||||||
.success()
|
.success()
|
||||||
.stdout("dummy-pager-from-config\n");
|
.stdout(predicate::eq("dummy-pager-from-config\n").normalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user