summaryrefslogtreecommitdiffstats
path: root/src/display.rs
diff options
context:
space:
mode:
authorNarawit Rakket <narawitrakket@hotmail.com>2022-07-03 14:34:06 +0700
committerAbin Simon <abinsimon10@gmail.com>2022-07-04 22:54:01 +0530
commite6d30ab081cb51fe50d0ac6e372c0141891546df (patch)
tree8c20380dc90037c0cab3d0a827707f134f34e8cb /src/display.rs
parentc17938224ba6777f0351ca2da989dfc1e3588c7e (diff)
refactor(test): replace `assert_eq` comparing `bool` with `assert`
Fix clippy lint https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
Diffstat (limited to 'src/display.rs')
-rw-r--r--src/display.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/display.rs b/src/display.rs
index 2986f58..fea7b7d 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -512,13 +512,12 @@ mod tests {
.to_string();
// check if the color is present.
- assert_eq!(
- true,
+ assert!(
output.starts_with("\u{1b}[38;5;"),
"{:?} should start with color",
output,
);
- assert_eq!(true, output.ends_with("[39m"), "reset foreground color");
+ assert!(output.ends_with("[39m"), "reset foreground color");
assert_eq!(get_visible_width(&output, false), *l, "visible match");
}
@@ -554,8 +553,8 @@ mod tests {
.to_string();
// check if the color is present.
- assert_eq!(false, output.starts_with("\u{1b}[38;5;"));
- assert_eq!(false, output.ends_with("[0m"));
+ assert!(!output.starts_with("\u{1b}[38;5;"));
+ assert!(!output.ends_with("[0m"));
assert_eq!(get_visible_width(&output, false), *l);
}