Skip to content

Commit

Permalink
Print path map when assertion fails
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Oct 27, 2023
1 parent e5466bd commit 89b085f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bevy_asset_loader/tests/mapped_path_use_slash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ fn expect(collection: Option<Res<AudioCollection>>, mut exit: EventWriter<AppExi
panic!("At least one asset collection was not inserted");
} else {
// make sure the asset paths use slash on all OS
assert!(collection.unwrap().files.contains_key("audio/plop.ogg"));
let files = &collection.unwrap().files;
assert!(
files.contains_key("audio/plop.ogg"),
"Expected path was not in {:?}",
files
);
exit.send(AppExit);
}
}

#[derive(AssetCollection, Resource)]
#[derive(AssetCollection, Resource, Debug)]
struct AudioCollection {
#[asset(path = "audio", collection(typed, mapped))]
files: HashMap<String, Handle<AudioSource>>,
Expand Down

0 comments on commit 89b085f

Please sign in to comment.