Refactor tests

Make use of the 'is' more to test the entire output.

Add test for no_color mode.

Replace several calls to format_string with calls that build a string
directly. I feel format_string is becoming unweildly and this simplfies
the tests
This commit is contained in:
andy.boot
2019-12-08 22:44:36 +00:00
parent a4ca78dbe4
commit 6a65570f3f
3 changed files with 125 additions and 193 deletions
+2 -3
View File
@@ -101,7 +101,6 @@ fn main() {
}
let use_apparent_size = options.is_present("display_apparent_size");
let use_full_path = options.is_present("display_full_paths");
let simplified_dirs = simplify_dir_names(target_dirs);
let (permissions, nodes) = get_dir_tree(&simplified_dirs, use_apparent_size, threads);
@@ -116,9 +115,9 @@ fn main() {
draw_it(
permissions,
use_full_path,
options.is_present("display_full_paths"),
options.is_present("reverse"),
!options.is_present("no_colors"),
options.is_present("no_colors"),
tree,
);
}