Merge branch 'juliancoffee/fix_test_parse_ron' into 'master'

Split asset_tweak tests to separate command

See merge request veloren/veloren!2552
This commit is contained in:
Marcel 2021-07-04 17:14:14 +00:00
commit f0f64a9fc0
2 changed files with 7 additions and 4 deletions

View File

@ -8,8 +8,9 @@ unittests:
- ln -s /dockercache/target target
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo test --package veloren-i18n --lib test_all_localizations -- --nocapture --ignored
- cargo test --package veloren-common-assets asset_tweak::tests --features asset_tweak --lib
- rm -r target/debug/incremental* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo test --features asset_tweak
- cargo test
retry:
max: 2

View File

@ -250,7 +250,6 @@ pub fn path_of(specifier: &str, ext: &str) -> PathBuf {
#[cfg(test)]
mod tests {
use std::{ffi::OsStr, fs::File};
use walkdir::WalkDir;
@ -260,7 +259,10 @@ mod tests {
let ext = OsStr::new("ron");
WalkDir::new(crate::ASSETS_PATH.as_path())
.into_iter()
.map(|ent| ent.unwrap().into_path())
.map(|ent| {
ent.expect("Failed to walk over asset directory")
.into_path()
})
.filter(|path| path.is_file())
.filter(|path| {
path.extension()
@ -268,7 +270,7 @@ mod tests {
.unwrap_or(false)
})
.for_each(|path| {
let file = File::open(&path).unwrap();
let file = File::open(&path).expect("Failed to open the file");
if let Err(err) = ron::de::from_reader::<_, ron::Value>(file) {
println!("{:?}", path);
println!("{:#?}", err);