From 0ca231a31bf1bcf1c3ae58f5ccfb392796660f5b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 17:43:52 -0800 Subject: [PATCH] .ai import: the test of an older instance without a template box defines its symbol The last case of an_instance_placed_on_the_canvas_by_an_older_file_stays_live read an instance of a symbol the file did not define, so it failed for that reason as well as for the missing template box. It now defines Dot, so it fails only when the reader places an older instance without a template box. --- crates/eps/src/import/ai/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 8c438d6151..dd623c99c1 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -5175,8 +5175,10 @@ fn an_instance_placed_on_the_canvas_by_an_older_file_stays_live() { let ((op, on), (np, nn)) = (both(&older_doc), both(&newer_doc)); assert!(op.iter().zip(np).all(|(a, b)| (a - b).abs() < 1e-9), "{op:?} {np:?}"); assert!(on.iter().zip(nn).all(|(a, b)| (a - b).abs() < 1e-9), "{on:?} {nn:?}"); - // Without a template box the canvas's place isn't known: the instance isn't read. - let e = read(stream(&layer(&older("Dot", [1.0, 0.0, 0.0, 1.0, 8111.0, 8192.0]))).as_bytes()); + // Without a template box the canvas's place isn't known: the instance isn't read, though Dot is + // defined and the same instance with a template box is read above. + let defs = symbols(&symbol("Dot", &dot(), 5)); + let e = read(stream(&format!("{defs}{}", layer(&older("Dot", [1.0, 0.0, 0.0, 1.0, 8111.0, 8192.0])))).as_bytes()); assert!(e.is_err_and(|e| e.contains("symbols"))); }