map tests
This commit is contained in:
parent
a5f13d72c6
commit
a48d85e056
1 changed files with 28 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue