summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-07-01 21:37:24 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-07-01 21:37:24 +0200
commit945ae96707f6b4065c89463047979a18ad8181aa (patch)
tree9c796d219201775dd4c534c9942e88546047ae46 /tests
parentd23a63288dec711b93dfa6702233c29287918cd9 (diff)
Started implementation of reading bitwise from json
Diffstat (limited to 'tests')
-rw-r--r--tests/expressive_to_bitwise_comparison.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/expressive_to_bitwise_comparison.rs b/tests/expressive_to_bitwise_comparison.rs
index 1dbbd74..e534fca 100644
--- a/tests/expressive_to_bitwise_comparison.rs
+++ b/tests/expressive_to_bitwise_comparison.rs
@@ -21,12 +21,21 @@ const STATE_PATH: &str = "tests/state0.json";
#[test]
fn reads_into_bitwise_correctly() {
- let (_, expressive_state) = input::json::read_expressive_state_from_file(STATE_PATH).expect("Failed to load expressive state");
- let bitwise_state = input::json::read_bitwise_state_from_file(STATE_PATH).expect("Failed to load bitwise state");
+ test_reading_from_replay("tests/after_200", 64);
+}
+
+fn test_reading_from_replay(replay_folder: &str, length: usize) {
+ for i in 0..length {
+ let state_file = format!("{}/Round {:03}/state.json", replay_folder, i);
+
+ let (_, expressive_state) = input::json::read_expressive_state_from_file(&state_file).expect("Failed to load expressive state");
+ let bitwise_state = input::json::read_bitwise_state_from_file(&state_file).expect("Failed to load bitwise state");
- assert_eq!(build_bitwise_from_expressive(&expressive_state), bitwise_state.clone());
+ assert_eq!(build_bitwise_from_expressive(&expressive_state), bitwise_state.clone(), "\nFailed on state {}\n", i);
+ }
}
+
proptest! {
#[test]
#[ignore]