mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Enforce consistent snapshot updates (#7744)
* Closes https://github.com/emilk/egui/issues/7647 This collects SnapshotResults within the Harness and adds a check to enforce snapshot results are merged in case multiple Harnesses are constructed within a test. This should make snapshot updates via kitdiff/accept_snapshots.sh way more useful since it should now always update all snapshots instead of only the first one per test.
This commit is contained in:
committed by
Emil Ernerfeldt
parent
e6fff4b018
commit
33fb2f300b
@@ -3,6 +3,7 @@ use egui_kittest::Harness;
|
||||
|
||||
#[test]
|
||||
fn test_image_blending() {
|
||||
let mut results = egui_kittest::SnapshotResults::new();
|
||||
for pixels_per_point in [1.0, 2.0] {
|
||||
let mut harness = Harness::builder()
|
||||
.with_pixels_per_point(pixels_per_point)
|
||||
@@ -21,5 +22,6 @@ fn test_image_blending() {
|
||||
harness.run();
|
||||
harness.fit_contents();
|
||||
harness.snapshot(format!("image_blending/image_x{pixels_per_point}"));
|
||||
results.extend_harness(&mut harness);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user