From 771a58544628b2155e5fbbf741c7398b8103fa0b Mon Sep 17 00:00:00 2001 From: Martin HART Date: Mon, 26 Oct 2020 13:14:44 +0100 Subject: [PATCH] add test_new_robot() --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index fb058eb..47f69ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -213,6 +213,18 @@ mod tests { 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] fn test_create_robot() { let mut r: Robot = Robot::new();