WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Closes#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.
let count = UNHANDLED_SNAPSHOT_RESULTS_COUNTER.with(|counter| {
874
+
letmut count = counter.borrow_mut();
875
+
*count += 1;
876
+
*count
877
+
});
878
+
879
+
#[expect(clippy::manual_assert)]
880
+
if count >= 2{
881
+
panic!(
882
+
r#"
883
+
Multiple SnapshotResults were dropped without being handled.
884
+
885
+
In order to allow consistent snapshot updates, all snapshot results within a test should be merged in a single SnapshotResults instance.
886
+
Usually this is handled internally in a harness. If you have multiple harnesses, you can merge the results using `Harness::take_snapshot_results` and `SnapshotResults::extend`.
0 commit comments