mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-24 05:27:45 +00:00
Add invalid data test for EXH
This commit is contained in:
parent
d9bf25cb0e
commit
e51b1024df
1 changed files with 19 additions and 0 deletions
19
src/exh.rs
19
src/exh.rs
|
@ -87,3 +87,22 @@ impl EXH {
|
||||||
EXH::read(&mut Cursor::new(&buffer)).ok()
|
EXH::read(&mut Cursor::new(&buffer)).ok()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use std::fs::read;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[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
|
||||||
|
EXH::from_existing(&read(d).unwrap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue