From 1ceff4dec8ad8e5062ff9488bc551ecafa1a5a55 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 13:59:20 -0800 Subject: [PATCH] .ai import: pen-samples test checks a brushed path after the samples The check that pen samples mark only the object before them used an unbrushed filled rectangle as the following object. A style with no brush ignores the samples, so the check passed even when the samples marked every later object. The following object is now an unsampled path with the same pen-varying Calligraphic brush, and the test asserts that it comes in as a path stroked with that brush. --- crates/eps/src/import/ai/tests.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index d160248a2d..58e009f020 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -10329,11 +10329,14 @@ fn a_brushed_path_with_samples_of_the_pen_keeps_its_drawn_look() { assert_eq!(a.len(), 1, "{a:#?}"); assert!(matches!(a[0].kind, NodeKind::Group { .. }), "the drawn look: {a:#?}"); assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); - // The samples belong to the path before them: a path after them is read as it was. - let after = format!("{path}{RED}{}f\n", rect_path(0.0, 0.0, 10.0, 10.0)); + // The samples belong to the path before them: a path after them with the same brush and no + // samples of its own comes in brushed. + let after = format!("{path}{}", brushed_path()); let a = art(&read_ok(&format!("{def}{style}{}", layer(&after))).doc); assert_eq!(a.len(), 2, "{a:#?}"); - assert!(matches!(a[1].kind, NodeKind::Path { .. }) && a[1].appearance.fill().is_some(), "{a:#?}"); + assert!(matches!(a[0].kind, NodeKind::Group { .. }), "the sampled path's drawn look: {a:#?}"); + assert!(matches!(a[1].kind, NodeKind::Path { .. }), "the path after the samples, brushed: {a:#?}"); + assert_eq!(a[1].appearance.stroke().and_then(|s| s.brush.as_deref()), Some("Six D"), "{a:#?}"); // Samples with no object before them in the layer mark nothing: the path after them is read. let first = format!("{PEN_SAMPLES}{}", brushed_path()); let a = art(&read_ok(&format!("{def}{style}{}", layer(&first))).doc);