Lines
100 %
Functions
Branches
use super::look;
use crate::chart::ChartLook;
#[test]
fn the_look_defaults_to_the_web_text_and_no_background() {
assert_eq!(look(0, -1).expect("default"), ChartLook::default());
}
fn the_look_carries_the_text_height_and_the_rgb_background() {
let given = look(18, 0x0000AA).expect("look");
assert_eq!(given.text_px, 18);
assert_eq!(given.background, Some([0, 0, 0xaa]));
assert_eq!(look(0, 0).expect("black").background, Some([0, 0, 0]));
assert_eq!(
look(0, 0x00FF_FFFF).expect("white").background,
Some([255; 3])
);
fn a_bad_text_height_or_background_is_refused() {
assert!(look(-1, -1).is_err());
assert!(look(5000, -1).is_err());
assert!(look(0, -2).is_err());
assert!(look(0, 0x0100_0000).is_err());