Added tests to colormap
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
b23f7a4de5
commit
9214f188bf
|
@ -86,3 +86,20 @@ pub fn map_char_to_color(data: u8) -> String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::{map_u8_to_color, map_char_to_color};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn map_u8_to_color_test() {
|
||||||
|
assert_eq!("\u{1b}[38;5;12m32\u{1b}[39m", map_u8_to_color(0x32));
|
||||||
|
assert_eq!("\u{1b}[38;5;6m64\u{1b}[39m", map_u8_to_color(0x64));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn map_char8_to_color_test() {
|
||||||
|
assert_eq!("\u{1b}[38;5;12m2\u{1b}[39m", map_char_to_color(0x32));
|
||||||
|
assert_eq!("\u{1b}[38;5;6md\u{1b}[39m", map_char_to_color(0x64));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue