From 90a7c7d34def7e5f92f2cd521fdc014e0cbd9906 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Thu, 6 Sep 2018 21:51:50 +0200 Subject: Added benchmarking for number of explored nodes --- tests/monte_carlo_test.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/monte_carlo_test.rs b/tests/monte_carlo_test.rs index 1fb4238..470c92d 100644 --- a/tests/monte_carlo_test.rs +++ b/tests/monte_carlo_test.rs @@ -19,3 +19,16 @@ fn it_does_a_normal_turn_successfully() { 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(20000); + strategy::monte_carlo_tree::choose_move(&state, start_time, max_time); + + assert!(start_time.to(PreciseTime::now()) < max_time + Duration::milliseconds(50)) +} -- cgit v1.2.3