From a48d85e0564450a8fd12cfe1b81cd71923d4fa0e Mon Sep 17 00:00:00 2001 From: Llywelwyn Date: Thu, 31 Aug 2023 01:27:58 +0100 Subject: [PATCH] map tests --- tests/map_test.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/map_test.rs b/tests/map_test.rs index 9f601d7..8e8de74 100644 --- a/tests/map_test.rs +++ b/tests/map_test.rs @@ -1,5 +1,32 @@ // tests/map_test.rs -use rust_rl::map::TileType; +use rust_rl::map::*; +use std::collections::HashSet; + +#[test] +fn map_settings() { + let (overmap, id, width, height, difficulty, name, short_name, depth) = ( + false, + 0, + 80, + 50, + 0, + "Test Map", + "Test Map", + 0, + ); + let map = Map::new(overmap, id, width, height, difficulty, name, short_name, depth); + + assert_eq!(map.overmap, overmap); + assert_eq!(map.id, id); + assert_eq!(map.width, width); + assert_eq!(map.height, height); + assert_eq!(map.difficulty, difficulty); + assert_eq!(map.name, name); + assert_eq!(map.short_name, short_name); + assert_eq!(map.depth, depth); + assert_eq!(map.tiles.len(), (width * height) as usize); + assert_eq!(map.messages, HashSet::new()); +} #[test] fn tiletype_equality() {