mirror of
https://github.com/bootandy/dust.git
synced 2025-12-05 20:40:11 -08:00
Better handling for color in terminal (#381)
* better handling for color in terminal * cleanup * cleanup * cargo fmt * clippy + tests * clean
This commit is contained in:
@@ -232,3 +232,19 @@ pub fn test_show_files_by_invert_regex_match_multiple() {
|
||||
assert!(!output.contains("test_dir_unicode"));
|
||||
assert!(output.contains("many"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_no_color() {
|
||||
let output = build_command(vec!["-c"]);
|
||||
// Red is 31
|
||||
assert!(!output.contains("\x1B[31m"));
|
||||
assert!(!output.contains("\x1B[0m"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_force_color() {
|
||||
let output = build_command(vec!["-C"]);
|
||||
// Red is 31
|
||||
assert!(output.contains("\x1B[31m"));
|
||||
assert!(output.contains("\x1B[0m"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user