mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-23 00:03:27 +01:00
Split snapshot tests into individual tests
This commit is contained in:
parent
0a5b3eaf3e
commit
0b1535f63b
@ -2,32 +2,34 @@ mod tester;
|
|||||||
|
|
||||||
use tester::BatTester;
|
use tester::BatTester;
|
||||||
|
|
||||||
static STYLES: &'static [&'static str] = &[
|
macro_rules! snapshot_tests {
|
||||||
"changes",
|
($($test_name: ident: $style: expr,)*) => {
|
||||||
"grid",
|
$(
|
||||||
"header",
|
#[test]
|
||||||
"numbers",
|
fn $test_name() {
|
||||||
"changes,grid",
|
let bat_tester = BatTester::new();
|
||||||
"changes,header",
|
bat_tester.test_snapshot($style);
|
||||||
"changes,numbers",
|
}
|
||||||
"grid,header",
|
)*
|
||||||
"grid,numbers",
|
};
|
||||||
"header,numbers",
|
}
|
||||||
"changes,grid,header",
|
|
||||||
"changes,grid,numbers",
|
snapshot_tests! {
|
||||||
"changes,header,numbers",
|
changes: "changes",
|
||||||
"grid,header,numbers",
|
grid: "grid",
|
||||||
"changes,grid,header,numbers",
|
header: "header",
|
||||||
"full",
|
numbers: "numbers",
|
||||||
"plain",
|
changes_grid: "changes,grid",
|
||||||
];
|
changes_header: "changes,header",
|
||||||
|
changes_numbers: "changes,numbers",
|
||||||
#[test]
|
grid_header: "grid,header",
|
||||||
fn test_snapshots() {
|
grid_numbers: "grid,numbers",
|
||||||
let bat_tester = BatTester::new();
|
header_numbers: "header,numbers",
|
||||||
|
changes_grid_header: "changes,grid,header",
|
||||||
for style in STYLES {
|
changes_grid_numbers: "changes,grid,numbers",
|
||||||
println!("testing {}", style);
|
changes_header_numbers: "changes,header,numbers",
|
||||||
bat_tester.test_snapshot(&*style);
|
grid_header_numbers: "grid,header,numbers",
|
||||||
}
|
changes_grid_header_numbers: "changes,grid,header,numbers",
|
||||||
|
full: "full",
|
||||||
|
plain: "plain",
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user