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

@@ -29,15 +29,20 @@ impl ToString for Position {
}
}
#[test]
fn test_position_from_string() {
assert_eq!(
Position::from("4,12".to_string()).unwrap(),
Position { x: 4, y: 12 }
);
}
#[cfg(test)]
mod test {
use crate::position::Position;
#[test]
fn test_position_to_string() {
assert_eq!(Position { x: 4, y: 12 }.to_string(), "4,12".to_string())
#[test]
fn test_position_from_string() {
assert_eq!(
Position::from("4,12".to_string()).unwrap(),
Position { x: 4, y: 12 }
);
}
#[test]
fn test_position_to_string() {
assert_eq!(Position { x: 4, y: 12 }.to_string(), "4,12".to_string())
}
}