From 890c228c855bc1496ebd44fb2474d7891ed64b28 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 16 Apr 2024 21:53:10 -0400 Subject: [PATCH] Add invalid data test for EXL --- src/exl.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/exl.rs b/src/exl.rs index 099aa71..e86bbca 100755 --- a/src/exl.rs +++ b/src/exl.rs @@ -125,4 +125,14 @@ mod tests { assert_eq!(existing_exl.write_to_buffer().unwrap(), exl); } + + #[test] + fn test_invalid() { + let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + d.push("resources/tests"); + d.push("random"); + + // Feeding it invalid data should not panic + EXL::from_existing(&read(d).unwrap()); + } }