mirror of
https://github.com/redstrate/Physis.git
synced 2025-06-08 15:47:45 +00:00
Add invalid data test for Material
This commit is contained in:
parent
a7a9a7855e
commit
11b554ef80
1 changed files with 18 additions and 0 deletions
18
src/mtrl.rs
18
src/mtrl.rs
|
@ -219,3 +219,21 @@ impl Material {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[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
|
||||||
|
Material::from_existing(&read(d).unwrap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue