aboutsummaryrefslogtreecommitdiff
path: root/vendor/owo-colors/src/tests.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/owo-colors/src/tests.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/owo-colors/src/tests.rs')
-rw-r--r--vendor/owo-colors/src/tests.rs83
1 files changed, 0 insertions, 83 deletions
diff --git a/vendor/owo-colors/src/tests.rs b/vendor/owo-colors/src/tests.rs
deleted file mode 100644
index c8688e8..0000000
--- a/vendor/owo-colors/src/tests.rs
+++ /dev/null
@@ -1,83 +0,0 @@
-use super::colors::*;
-use super::OwoColorize;
-use crate::colors::css::Lavender;
-use crate::{AnsiColors, DynColors};
-
-#[test]
-fn test_fg() {
- assert_eq!("test".fg::<Black>().to_string(), "\x1b[30mtest\x1b[39m");
- assert_eq!("blah blah".red().to_string(), "\x1b[31mblah blah\x1b[39m");
-}
-
-#[test]
-fn test_bg() {
- assert_eq!("test".bg::<Black>().to_string(), "\x1b[40mtest\x1b[49m");
- assert_eq!(
- "blah blah".on_red().to_string(),
- "\x1b[41mblah blah\x1b[49m"
- );
-}
-
-#[test]
-fn test_dyn_fg() {
- assert_eq!(
- "test".color(AnsiColors::Black).to_string(),
- "\x1b[30mtest\x1b[39m"
- );
- assert_eq!(
- "blah blah".color(AnsiColors::Red).to_string(),
- "\x1b[31mblah blah\x1b[39m"
- );
-}
-
-#[test]
-fn test_dyn_bg() {
- assert_eq!(
- "test".on_color(AnsiColors::Black).to_string(),
- "\x1b[40mtest\x1b[49m"
- );
- assert_eq!(
- "blah blah".on_color(AnsiColors::Red).to_string(),
- "\x1b[41mblah blah\x1b[49m"
- );
-}
-
-#[test]
-fn test_hex() {
- assert_eq!(format!("{:08X}", 0xa.red()), "\x1b[31m0000000A\x1b[39m");
-}
-
-#[test]
-fn test_css_name() {
- assert_eq!(
- "test".fg::<Lavender>().to_string(),
- "\x1b[38;2;230;230;250mtest\x1b[39m"
- );
-}
-
-#[test]
-fn test_parse() {
- macro_rules! assert_parse {
- ($($str:literal == $eq:expr),* $(,)?) => {
- $(
- assert_eq!($eq, $str.parse().unwrap());
- )*
- }
- }
-
- assert_parse!(
- "yellow" == DynColors::Ansi(AnsiColors::Yellow),
- "blue" == DynColors::Ansi(AnsiColors::Blue),
- "#eb4034" == DynColors::Rgb(235, 64, 52),
- );
-}
-
-#[test]
-fn default_color() {
- assert_eq!(
- format_args!("red red red {} no color", "default color".default_color())
- .red()
- .to_string(),
- "\x1b[31mred red red \x1b[39mdefault color\x1b[39m no color\x1b[39m"
- );
-}