imports to lib.rs, creating unit tests
This commit is contained in:
parent
568df55795
commit
3464e9447c
13 changed files with 697 additions and 639 deletions
22
tests/map_test.rs
Normal file
22
tests/map_test.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// tests/map_test.rs
|
||||
use rust_rl::map::TileType;
|
||||
|
||||
#[test]
|
||||
fn tiletype_equality() {
|
||||
let tile1 = TileType::ImpassableMountain;
|
||||
let tile2 = TileType::ImpassableMountain;
|
||||
assert_eq!(tile1, tile2);
|
||||
|
||||
let tile3 = TileType::Floor;
|
||||
assert_ne!(tile1, tile3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tiletype_with_var_equality() {
|
||||
let tile1 = TileType::ToLocal(5);
|
||||
let tile2 = TileType::ToLocal(3);
|
||||
assert_ne!(tile1, tile2);
|
||||
|
||||
let tile3 = TileType::ToLocal(3);
|
||||
assert_eq!(tile2, tile3);
|
||||
}
|
||||
2
tests/mod.rs
Normal file
2
tests/mod.rs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// tests/mod.rs
|
||||
mod map_test;
|
||||
Loading…
Add table
Add a link
Reference in a new issue