mirror of
https://github.com/pcvolkmer/checkbar.git
synced 2025-04-19 19:16:50 +00:00
test: test output depending on environment
This commit is contained in:
parent
3399b541e7
commit
d0bc71c180
@ -96,10 +96,14 @@ mod tests {
|
|||||||
state: CheckState::Up,
|
state: CheckState::Up,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(
|
if Term::stdout().is_term() {
|
||||||
check_result.to_string(),
|
assert_eq!(check_result.to_string(), "\u{1b}[32mtest\u{1b}[0m")
|
||||||
r##"{"color":"#00FF00","full_text":"test","name":"test","separator_block_width":16}"##
|
} else {
|
||||||
)
|
assert_eq!(
|
||||||
|
check_result.to_string(),
|
||||||
|
r##"{"color":"#00FF00","full_text":"test","name":"test","separator_block_width":16}"##
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -109,10 +113,14 @@ mod tests {
|
|||||||
state: CheckState::Warn,
|
state: CheckState::Warn,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(
|
if Term::stdout().is_term() {
|
||||||
check_result.to_string(),
|
assert_eq!(check_result.to_string(), "\u{1b}[33mtest\u{1b}[0m")
|
||||||
r##"{"color":"#FFFF00","full_text":"test","name":"test","separator_block_width":16}"##
|
} else {
|
||||||
)
|
assert_eq!(
|
||||||
|
check_result.to_string(),
|
||||||
|
r##"{"color":"#FFFF00","full_text":"test","name":"test","separator_block_width":16}"##
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -122,9 +130,13 @@ mod tests {
|
|||||||
state: CheckState::Down,
|
state: CheckState::Down,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(
|
if Term::stdout().is_term() {
|
||||||
check_result.to_string(),
|
assert_eq!(check_result.to_string(), "\u{1b}[31mtest\u{1b}[0m")
|
||||||
r##"{"color":"#FF0000","full_text":"test","name":"test","separator_block_width":16}"##
|
} else {
|
||||||
)
|
assert_eq!(
|
||||||
|
check_result.to_string(),
|
||||||
|
r##"{"color":"#FF0000","full_text":"test","name":"test","separator_block_width":16}"##
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user