From 8c00c2830cf448b3baa580e04ce27975e385967e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 27 Aug 2026 02:51:17 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test(app):=20the=20refusal=20fix?= =?UTF-8?q?ture=20flips=20=E2=80=94=20mono=20joins=20stereo=20now,=20stere?= =?UTF-8?q?o=20onto=20mono=20refuses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The end-to-end refusal test imported mono test_ac3.mp4 into a stereo timeline, the exact pair engine::audio::widen just legalized. The refusal left standing is the reverse, so the test opens the mono fixture as its timeline and refuses stereo test_av.mp4 instead; the accepted-row half now rides mono test_audio_only.mp4 (3 s, 90 frames). --- crates/app/src/tests/editing.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/crates/app/src/tests/editing.rs b/crates/app/src/tests/editing.rs index 517d48a..7b4f415 100644 --- a/crates/app/src/tests/editing.rs +++ b/crates/app/src/tests/editing.rs @@ -1461,26 +1461,31 @@ fn group_reaches_the_sound_before_a_video_layer_over_it() { /// refused file cannot leave a row behind. #[test] fn a_refused_import_leaves_no_row_and_an_accepted_one_is_whole() { - let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture"); + // A mono timeline: since a mono track up-mixes onto a wider timeline + // (`engine::audio::widen`), the refusal left standing is the reverse -- + // a wider file cannot join a mono timeline, nothing narrows a source. + let mut session = PlaybackSession::open(asset("test_ac3.mp4")).expect("open the fixture"); // Silent like the engine suite: this opens the real device. session.set_gain(0.0); assert_eq!(session.sources().len(), 1); // 640x360 joins now (the project canvas places it), and so does a file // with no sound (it plays silence over its span). What is left is one - // output device: a mono track cannot join a stereo timeline. + // output device: a stereo track cannot join a mono timeline. let refusal = session - .import(&asset("test_ac3.mp4")) - .expect_err("a mono track must not join a stereo timeline") + .import(&asset("test_av.mp4")) + .expect_err("a stereo track must not join a mono timeline") .to_string(); assert!(refusal.contains("audio"), "refusal must name it: {refusal}"); assert_eq!(session.sources().len(), 1, "a refusal added a row"); - // An accepted one does add a row, and it reads as the whole file: 4 s + // An accepted one does add a row, and it reads as the whole file: 3 s // at 30 fps, its own length and not one taken off the lanes. - session.import(&asset("test_av2.mp4")).expect("av2 matches"); + session + .import(&asset("test_audio_only.mp4")) + .expect("mono matches mono"); assert_eq!(session.sources().len(), 2); let second = session.sources()[1].path.clone(); - assert_eq!(session.file_frames(&second), 120); - assert_eq!(timecode(120. / 30., 30.), "00:00:04:00"); + assert_eq!(session.file_frames(&second), 90); + assert_eq!(timecode(90. / 30., 30.), "00:00:03:00"); } /// What the Add button and a dropped row both do, minus the pointer: the