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;
|
||||
|
||||
static STYLES: &'static [&'static str] = &[
|
||||
"changes",
|
||||
"grid",
|
||||
"header",
|
||||
"numbers",
|
||||
"changes,grid",
|
||||
"changes,header",
|
||||
"changes,numbers",
|
||||
"grid,header",
|
||||
"grid,numbers",
|
||||
"header,numbers",
|
||||
"changes,grid,header",
|
||||
"changes,grid,numbers",
|
||||
"changes,header,numbers",
|
||||
"grid,header,numbers",
|
||||
"changes,grid,header,numbers",
|
||||
"full",
|
||||
"plain",
|
||||
];
|
||||
|
||||
macro_rules! snapshot_tests {
|
||||
($($test_name: ident: $style: expr,)*) => {
|
||||
$(
|
||||
#[test]
|
||||
fn test_snapshots() {
|
||||
fn $test_name() {
|
||||
let bat_tester = BatTester::new();
|
||||
bat_tester.test_snapshot($style);
|
||||
}
|
||||
)*
|
||||
};
|
||||
}
|
||||
|
||||
for style in STYLES {
|
||||
println!("testing {}", style);
|
||||
bat_tester.test_snapshot(&*style);
|
||||
}
|
||||
snapshot_tests! {
|
||||
changes: "changes",
|
||||
grid: "grid",
|
||||
header: "header",
|
||||
numbers: "numbers",
|
||||
changes_grid: "changes,grid",
|
||||
changes_header: "changes,header",
|
||||
changes_numbers: "changes,numbers",
|
||||
grid_header: "grid,header",
|
||||
grid_numbers: "grid,numbers",
|
||||
header_numbers: "header,numbers",
|
||||
changes_grid_header: "changes,grid,header",
|
||||
changes_grid_numbers: "changes,grid,numbers",
|
||||
changes_header_numbers: "changes,header,numbers",
|
||||
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