mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Display: No padding if no bars drawn
If not drawing the percent bars do not add padding to the filenames https://github.com/bootandy/dust/issues/89
This commit is contained in:
@@ -32,6 +32,16 @@ pub fn test_basic_output() {
|
||||
assert!(output.contains("a_file "));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_output_no_bars_means_no_excess_spaces() {
|
||||
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||
let output = cmd.arg("-b").arg("src/test_dir/").unwrap().stdout;
|
||||
let output = str::from_utf8(&output).unwrap();
|
||||
// If bars are not being shown we don't need to pad the output with spaces
|
||||
assert!(output.contains("many"));
|
||||
assert!(!output.contains("many "));
|
||||
}
|
||||
|
||||
// "windows" result data can vary by host (size seems to be variable by one byte); fix code vs test and re-enable
|
||||
#[cfg_attr(target_os = "windows", ignore)]
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user