Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SnapshotResults struct to egui_kittest #5672

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

lucasmerlin
Copy link
Collaborator

@lucasmerlin lucasmerlin commented Feb 4, 2025

I got annoyed by all the slightly different variations of "collect snapshot results and unwrap them at the end of test" I've written, so I added a struct to make this nice and simple.

One controversial thing: It panics when dropped. I wanted to ensure people cannot forget to unwrap the results at the end, and this was the best thing I could come up with. I don't think this is possible via clippy lint or something like that.

  • I have followed the instructions in the PR template

@lucasmerlin lucasmerlin added egui_kittest feature New feature or request labels Feb 4, 2025
@lucasmerlin lucasmerlin force-pushed the lucas/add_snapshot_results branch from 82be366 to 77e5820 Compare February 4, 2025 10:36
Copy link

github-actions bot commented Feb 4, 2025

Preview available at https://egui-pr-preview.github.io/pr/5672-lucasaddsnapshotresults
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

crates/egui_kittest/src/snapshot.rs Show resolved Hide resolved
crates/egui_kittest/src/snapshot.rs Outdated Show resolved Hide resolved
crates/egui_kittest/src/snapshot.rs Outdated Show resolved Hide resolved
@lucasmerlin lucasmerlin merged commit b8051cc into master Feb 4, 2025
46 checks passed
@lucasmerlin lucasmerlin deleted the lucas/add_snapshot_results branch February 4, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui_kittest feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants