Decreased running time of monte carlo test
[entelect-challenge-tower-defence.git] / tests / monte_carlo_test.rs
index 479b36d..87feadb 100644 (file)
@@ -10,10 +10,12 @@ const STATE_PATH: &str = "tests/state0.json";
 #[test]
 fn it_does_a_normal_turn_successfully() {
     let start_time = PreciseTime::now();
-    let (settings, state) = match input::json::read_state_from_file(STATE_PATH) {
+    let (settings, state) = match input::json::read_expressive_state_from_file(STATE_PATH) {
         Ok(ok) => ok,
         Err(error) => panic!("Error while parsing JSON file: {}", error)
     };
-    let max_time = Duration::milliseconds(1950);
+    let max_time = Duration::milliseconds(200);
     strategy::monte_carlo::choose_move(&settings, &state, &start_time, max_time);
+
+    assert!(start_time.to(PreciseTime::now()) < max_time + Duration::milliseconds(10))
 }