1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-03 11:52:26 +01:00

Added three new snapshot tests for --tabs and --wrap.

This commit is contained in:
eth-p
2018-09-11 13:47:01 -07:00
parent d90797f8e9
commit c1e1f753cf
6 changed files with 153 additions and 26 deletions

View File

@@ -38,13 +38,14 @@ impl BatTester {
BatTester { temp_dir, exe }
}
pub fn test_snapshot(&self, name: &str, style: &str, tab_width: u32) {
pub fn test_snapshot(&self, name: &str, style: &str, tab_width: u32, wrap: bool) {
let output = Command::new(&self.exe)
.current_dir(self.temp_dir.path())
.args(&[
"sample.rs",
"--decorations=always",
"--terminal-width=80",
&format!("--wrap={}", if wrap { "character" } else { "never" }),
&format!("--tabs={}", tab_width),
&format!("--style={}", style),
]).output()