1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-22 04:37:46 +00:00

Add invalid data test for FileInfo

This commit is contained in:
Joshua Goins 2024-04-16 21:53:32 -04:00
parent 890c228c85
commit cfe08de0d7

View file

@ -142,4 +142,14 @@ mod tests {
assert_eq!(*valid_fiin, testing_fiin.write_to_buffer().unwrap()); assert_eq!(*valid_fiin, testing_fiin.write_to_buffer().unwrap());
} }
#[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
FileInfo::from_existing(&read(d).unwrap());
}
} }