Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

fix(shortcuts): exempt contextual pairs in the ui-conflicts test

mahmatiasacbf7c70f2cd
diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs
index 374e54f1c..d4dc53714 100644
--- a/crates/ui-egui/src/shortcuts.rs
+++ b/crates/ui-egui/src/shortcuts.rs
@@ -1136,7 +1136,8 @@ mod tests {
}
for (i, (k, a)) in ui.iter().enumerate() {
for (k2, b) in &ui[i + 1..] {
- assert!(k != k2, "{a} and {b} share a key");
+ let contextual = CONTEXTUAL.iter().any(|(x, y)| (x == a && y == b) || (x == b && y == a));
+ assert!(k != k2 || contextual, "{a} and {b} share a key");
}
}
for (i, (k, a)) in engine.iter().enumerate() {