test configurations

This commit is contained in:
2020-04-19 08:13:55 +01:00
parent d0614b6de2
commit 76e6c2477c
15 changed files with 515 additions and 451 deletions

View File

@@ -24,27 +24,20 @@ impl ToString for Colour {
}
}
#[test]
fn test_colour_from_string() {
assert_eq!(
Colour::from("0,255,0".to_string()),
Colour {
red: 0,
green: 255,
blue: 0
}
);
}
#[cfg(test)]
mod test {
use crate::colour::Colour;
#[test]
fn test_colour_to_string() {
assert_eq!(
Colour {
red: 22,
green: 33,
blue: 44
}
.to_string(),
"22,33,44".to_string()
);
#[test]
fn test_colour_from_string() {
assert_eq!(
Colour::from("0,255,0".to_string()),
Colour { red: 0, green: 255, blue: 0 }
);
}
#[test]
fn test_colour_to_string() {
assert_eq!(Colour { red: 22, green: 33, blue: 44, }.to_string(), "22,33,44".to_string());
}
}