Set up (failing) property test for working of new game state
[entelect-challenge-tower-defence.git] / tests / monte_carlo_test.rs
1 extern crate zombot;
2 extern crate time;
3 use time::{PreciseTime, Duration};
4
5 use zombot::*;
6
7 const STATE_PATH: &str = "tests/state0.json";
8
9 // there are assertions in the game engine, run when it's in debug mode
10 #[test]
11 fn it_does_a_normal_turn_successfully() {
12     let start_time = PreciseTime::now();
13     let (settings, state) = match input::json::read_expressive_state_from_file(STATE_PATH) {
14         Ok(ok) => ok,
15         Err(error) => panic!("Error while parsing JSON file: {}", error)
16     };
17     let max_time = Duration::milliseconds(1950);
18     strategy::monte_carlo::choose_move(&settings, &state, &start_time, max_time);
19 }