EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
#1167: test: a marker edit keeps the viewer frames (fails on main; reproduces the audio pause)
Kristian Myram9e8112499c99
diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rsindex 9a3398d62..ae0c54971 100644--- a/crates/ui-egui/src/frames.rs+++ b/crates/ui-egui/src/frames.rs@@ -1970,4 +1970,19 @@ mod tests {switch(&mut s, inner, solid, "video", true);assert_ne!(at(&s), o1);}++ #[test]+ fn markers_keep_the_frames() {+ use effectcraft_engine::Session;+ use serde_json::json;+ let mut s = Session::default();+ let id = |v: serde_json::Value, k: &str| v[k].as_u64().unwrap();+ let outer = ItemId(id(s.execute("comp.new", json!({"name": "Outer", "width": 8, "height": 8, "duration": 1})).unwrap(), "comp"));+ let solid = id(s.execute("layer.newSolid", json!({"comp": outer.0, "color": "#ff0000"})).unwrap(), "layer");+ let f = Frames::default();+ let at = |s: &Session| f.content_of(&s.project, s.revision, outer);+ let o0 = at(&s);+ s.execute("layer.addMarker", json!({"comp": outer.0, "layers": [solid], "time": 0.5, "comment": "beat"})).unwrap();+ assert_eq!(at(&s), o0, "a marker changes no pixels, so it keeps the frames");+ }}