Add unit test to make sure we are not missing any themes

This commit is contained in:
sharkdp 2020-05-27 08:47:07 +02:00 committed by David Peter
parent fe20328ab7
commit 2ab6474761
2 changed files with 35 additions and 0 deletions

BIN
assets/themes.bin vendored

Binary file not shown.

35
tests/assets.rs Normal file
View File

@ -0,0 +1,35 @@
use bat::assets::HighlightingAssets;
/// This test ensures that we are not accidentally removing themes due to submodule updates.
#[test]
fn all_themes_are_present() {
let assets = HighlightingAssets::from_binary();
let mut themes: Vec<_> = assets.themes().collect();
themes.sort();
assert_eq!(
themes,
vec![
"1337",
"DarkNeon",
"Dracula",
"GitHub",
"Monokai Extended",
"Monokai Extended Bright",
"Monokai Extended Light",
"Monokai Extended Origin",
"Nord",
"OneHalfDark",
"OneHalfLight",
"Solarized (dark)",
"Solarized (light)",
"Sublime Snazzy",
"TwoDark",
"ansi-dark",
"ansi-light",
"base16",
"zenburn"
]
);
}