bevy_sprite3d
bevy_sprite3d copied to clipboard
Unit testing issue
Is that possible to provide some simple way to test the systems with Sprite3dParams? Some guidelines will be ok too. Looks like it panics in the bundle function:
impl AtlasSprite3d {
pub fn bundle(self, params: &mut Sprite3dParams ) -> AtlasSprite3dBundle {
let atlas = params.atlases.get(&self.atlas).unwrap();
let image = params.images.get(&atlas.texture).unwrap(); // here
...
Is this the same issue as #5 (calling asset_server.load()
but not waiting for the asset to finish loading before calling bundle()
)? If so, we could probably provide a more clear error message, though iirc there were more possible things that could cause a None
with that get
call than just forgetting to load the image, which is why I didn't just override the error message the last time this came up.
Also, just to be clear, are you requesting that there's unit testing done within the crate - or that the crate isn't working in the context of your project's unit tests?
Cheers
Thanks for your response.
Looks like the reason is the same. I'm trying to write some unit tests. Thus, I could say that both cases are true. It isn't working for my tests and that would be great to provide some Unit tests for the crate. This way you can both cover the crate with tests and show it's users how to write the unit tests in their projects.
Nice!
In that case it looks like the fix would depend very heavily on your project structure, and what you're trying to accomplish with your unit tests. Is there some specific test structure and goal you're looking to make work? As is, I'm not certain what changes we would want done to the crate since I don't know what mode of interaction we're supposed to be facilitating.
If you could give a minimum example of a failing test that you would expect to work, that would help a lot :)