diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 21:26:49 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 21:26:49 +0200 |
commit | 7ec48d0d454499177b63bc5bd512a3a2d6baa839 (patch) | |
tree | 23d34d45dbb3ae977710361501a3dde3544734d1 /tests/monte_carlo_test.rs | |
parent | 1e21ebed15321aacbba53121cb40bbc60f4db1cc (diff) |
Refile for merging repos
Diffstat (limited to 'tests/monte_carlo_test.rs')
-rw-r--r-- | tests/monte_carlo_test.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/monte_carlo_test.rs b/tests/monte_carlo_test.rs deleted file mode 100644 index cec3256..0000000 --- a/tests/monte_carlo_test.rs +++ /dev/null @@ -1,34 +0,0 @@ -extern crate zombot; -extern crate time; -use time::{PreciseTime, Duration}; - -use zombot::*; - -const STATE_PATH: &str = "tests/state0.json"; - -// there are assertions in the game engine, run when it's in debug mode -#[test] -fn it_does_a_normal_turn_successfully() { - let start_time = PreciseTime::now(); - let state = match input::json::read_bitwise_state_from_file(STATE_PATH) { - Ok(ok) => ok, - Err(error) => panic!("Error while parsing JSON file: {}", error) - }; - let max_time = Duration::milliseconds(200); - strategy::monte_carlo::choose_move(&state, start_time, max_time); - - assert!(start_time.to(PreciseTime::now()) < max_time + Duration::milliseconds(50)) -} - -#[test] -fn it_does_a_normal_tree_serach_turn_successfully() { - let start_time = PreciseTime::now(); - let state = match input::json::read_bitwise_state_from_file(STATE_PATH) { - Ok(ok) => ok, - Err(error) => panic!("Error while parsing JSON file: {}", error) - }; - let max_time = Duration::milliseconds(200); - strategy::monte_carlo_tree::choose_move(&state, start_time, max_time); - - assert!(start_time.to(PreciseTime::now()) < max_time + Duration::milliseconds(50)) -} |