test configurations
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user