Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
disco07 committed Mar 19, 2023
1 parent 703c97b commit e244d3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn split_colors(color: &str) -> String {
#[cfg(test)]
mod tests {
use crate::cell::ICell;
use crate::color::Colorizer;
use crate::color::{split_colors, Colorizer};
#[test]
fn test_colorize_white() {
let colour = "string".cell().color("#ffffff");
Expand All @@ -88,4 +88,10 @@ mod tests {
let colour = "string".cell().color("black");
assert_eq!(colour.to_string(), "string\u{1b}[0m")
}
#[test]
fn test_split_colors() {
let string = String::from("\u{1b}[38;2;255;255;255mstring\u{1b}[0m");
let split_color = split_colors(&string);
assert_eq!(split_color, "string ")
}
}

0 comments on commit e244d3c

Please sign in to comment.