add test_new_robot()

This commit is contained in:
Martin HART 2020-10-26 13:14:44 +01:00
parent 997b9d8dfb
commit 771a585446
1 changed files with 12 additions and 0 deletions

View File

@ -213,6 +213,18 @@ mod tests {
assert_eq!(w.map, vec!['.'; 25]); assert_eq!(w.map, vec!['.'; 25]);
} }
#[test]
fn test_new_robot() {
let mut r: Robot = Robot::new();
assert_eq!(r.id, 0);
assert!(matches!(r.o, Orientation::N));
assert_eq!(r.p.x, 0);
assert_eq!(r.p.y, 0);
assert_eq!(r.q.size(), 0);
}
#[test] #[test]
fn test_create_robot() { fn test_create_robot() {
let mut r: Robot = Robot::new(); let mut r: Robot = Robot::new();