Add encode/decode tests: roundtrip, debug snapshot

This commit is contained in:
2026-03-10 14:20:47 -07:00
parent d73faf64c7
commit 2e59e9a760
3 changed files with 30508 additions and 0 deletions
+21
View File
@@ -492,3 +492,24 @@ impl Stat {
Ok(result)
}
}
#[cfg(test)]
mod tests {
use super::*;
use insta::assert_debug_snapshot;
const BYTES: &[u8] = include_bytes!("../tests/fixtures/all.zzt");
#[test]
fn roundtrip() {
let world = World::from_bytes(BYTES).unwrap();
let encoded = world.to_bytes().unwrap();
assert_eq!(BYTES, &encoded[..]);
}
#[test]
fn decode_snapshot() {
let world = World::from_bytes(BYTES).unwrap();
assert_debug_snapshot!(world);
}
}
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.