diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-05-31 10:55:47 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-05-31 10:56:25 -0400 |
commit | cfdd4492d4e9d88f0ce7f7f5d29118dcda67e609 (patch) | |
tree | c049511f100a072662f27b6e69e9ade077151e73 /src/tests | |
parent | e2ac911a41424a3130f305cf199908b1ee5a9fcc (diff) |
In tests, interpret color string as style string
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/ansi_test_utils.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tests/ansi_test_utils.rs b/src/tests/ansi_test_utils.rs index 82a5aef6..6e20fb1c 100644 --- a/src/tests/ansi_test_utils.rs +++ b/src/tests/ansi_test_utils.rs @@ -3,7 +3,6 @@ pub mod ansi_test_utils { use ansi_term; use console::strip_ansi_codes; - use crate::color; use crate::config::Config; use crate::paint; use crate::style::Style; @@ -17,14 +16,17 @@ pub mod ansi_test_utils { output: &str, line_number: usize, expected_prefix: &str, - expected_color: &str, + expected_style: &str, config: &Config, ) { let line = output.lines().nth(line_number).unwrap(); assert!(strip_ansi_codes(line).starts_with(expected_prefix)); assert!(has_foreground_color( line, - color::color_from_rgb_or_ansi_code(expected_color, config.true_color) + Style::from_str(expected_style, None, None, None, config.true_color, false) + .ansi_term_style + .foreground + .unwrap() )); } |