use chessly::PerftTestCase; use colored::*; const PERF_FILE_PATH: &str = "tests/perfsuite.epd"; #[test] fn test_positions() { let perf_data = std::fs::read_to_string(PERF_FILE_PATH).expect("Unable to read file"); for case in perf_data.lines().map(PerftTestCase::try_from) { let case = case.expect("Invalid test case"); println!("FEN: {}", case.fen.bold()); case.run(5, |result| { let message = if result.is_ok() { "OK".green() } else { "FAIL".red() }; println!( "Depth: {} - {}\t{} ({} ms)", result.depth, result.expected, message, result.duration.as_millis() ); }); } }