mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-03 21:25:09 +01:00
9159341714
This changes how the files are named (to allow for snapshots that aren't directly related to the --style argument) and fixes the generate_snapshots.py script to work with the latest version of bat. Three new tests are also introduced: - tabs_4 - Tab expansion with a width of 4. - tabs_8 - Tab expansion with a width of 8. - tabs_passthrough - No tab expansion.
39 lines
1.3 KiB
Rust
39 lines
1.3 KiB
Rust
mod tester;
|
|
|
|
use tester::BatTester;
|
|
|
|
macro_rules! snapshot_tests {
|
|
($($test_name: ident: $style: expr => [tabs: $tabs:expr],)*) => {
|
|
$(
|
|
#[test]
|
|
fn $test_name() {
|
|
let bat_tester = BatTester::new();
|
|
bat_tester.test_snapshot(stringify!($test_name), $style, $tabs);
|
|
}
|
|
)*
|
|
};
|
|
}
|
|
|
|
snapshot_tests! {
|
|
changes: "changes" => [tabs: 8],
|
|
grid: "grid" => [tabs: 8],
|
|
header: "header" => [tabs: 8],
|
|
numbers: "numbers" => [tabs: 8],
|
|
changes_grid: "changes,grid" => [tabs: 8],
|
|
changes_header: "changes,header" => [tabs: 8],
|
|
changes_numbers: "changes,numbers" => [tabs: 8],
|
|
grid_header: "grid,header" => [tabs: 8],
|
|
grid_numbers: "grid,numbers" => [tabs: 8],
|
|
header_numbers: "header,numbers" => [tabs: 8],
|
|
changes_grid_header: "changes,grid,header" => [tabs: 8],
|
|
changes_grid_numbers: "changes,grid,numbers" => [tabs: 8],
|
|
changes_header_numbers: "changes,header,numbers" => [tabs: 8],
|
|
grid_header_numbers: "grid,header,numbers" => [tabs: 8],
|
|
changes_grid_header_numbers: "changes,grid,header,numbers" => [tabs: 8],
|
|
full: "full" => [tabs: 8],
|
|
plain: "plain" => [tabs: 8],
|
|
tabs_passthrough: "full" => [tabs: 0],
|
|
tabs_4: "full" => [tabs: 4],
|
|
tabs_8: "full" => [tabs: 8],
|
|
}
|