add test_new_robot()
This commit is contained in:
parent
997b9d8dfb
commit
771a585446
12
src/main.rs
12
src/main.rs
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user