diff --git a/core/tests/replay.rs b/core/tests/replay.rs index 51711cf..53f4e1e 100644 --- a/core/tests/replay.rs +++ b/core/tests/replay.rs @@ -106,6 +106,13 @@ fn a_recording_can_start_in_the_middle_of_a_session() { } assert_eq!(recording.tick_count(), 70); assert_eq!(recording.end_tick(), 120); + + // Decoding derives the start tick from the stored start world. The + // decoded recording must end at the same tick and equal the original. + let (decoded, _) = Recording::from_bytes(&recording.to_bytes(&world)).unwrap(); + assert_eq!(decoded.end_tick(), 120); + assert_eq!(decoded, recording); + assert_eq!(recording.replay(), Ok(world)); }