bat/tests/snapshot_tests.rs
Martin Nordholts 621ab6078f CI: Check MSRV without git feature enabled
git2-rs MSRV policy is to only support latest stable rust (see
https://github.com/rust-lang/git2-rs#rust-version-requirements), so it
does not make sense to run our MSRV tests with git enabled.
2022-08-25 19:27:55 +02:00

45 lines
1.7 KiB
Rust

#[cfg(feature = "git")]
mod tester;
macro_rules! snapshot_tests {
($($test_name: ident: $style: expr,)*) => {
$(
#[test]
#[cfg(feature = "git")]
fn $test_name() {
let bat_tester = tester::BatTester::default();
bat_tester.test_snapshot(stringify!($test_name), $style);
}
)*
};
}
snapshot_tests! {
changes: "changes",
grid: "grid",
header: "header",
numbers: "numbers",
rule: "rule",
changes_grid: "changes,grid",
changes_header: "changes,header",
changes_numbers: "changes,numbers",
changes_rule: "changes,rule",
grid_header: "grid,header",
grid_numbers: "grid,numbers",
grid_rule: "grid,rule",
header_numbers: "header,numbers",
header_rule: "header,rule",
changes_grid_header: "changes,grid,header",
changes_grid_numbers: "changes,grid,numbers",
changes_grid_rule: "changes,grid,rule",
changes_header_numbers: "changes,header,numbers",
changes_header_rule: "changes,header,rule",
grid_header_numbers: "grid,header,numbers",
grid_header_rule: "grid,header,rule",
header_numbers_rule: "header,numbers,rule",
changes_grid_header_numbers: "changes,grid,header,numbers",
changes_grid_header_rule: "changes,grid,header,rule",
changes_grid_header_numbers_rule: "changes,grid,header,numbers,rule",
full: "full",
plain: "plain",
}