From a09bd7eb698ec689cfa16e1298a9a10edbb0d227 Mon Sep 17 00:00:00 2001 From: giswqs Date: Sun, 15 Nov 2026 16:45:12 -0500 Subject: [PATCH] test(engine): a streamed export's Z/M loss is said in the read's words #2196 made an export of a layer read in place keep the counted note its fresh read gives ("1 feature had Z or M values ... dropped") in place of the generic "its geometry has no Z or M values" warning (coalesce_read_zm). dropped_z_values_are_said_on_import_and_export still looked only for the generic text, so it has failed on main since. Accept the counted note for the streamed case; a layer read whole must still give the export's own warning, and a 2D layer nothing. --- crates/engine/src/tests.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 7ff5306785..283fb14132 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -23002,7 +23002,13 @@ fn dropped_z_values_are_said_on_import_and_export() { let out = dir.join(format!("out-{stream}.geojson")); let mark = s.notice_mark(); s.run("share.exportLayer", &json!({"layer": id, "path": out})).unwrap(); - let said = |s: &Session, mark| s.notices_since(mark).iter().any(|n| n.text.contains("its geometry has no Z or M values")); + // A layer read whole gives the export's own warning; one read in place reads its file + // again for the export, and that read's counted note stands in for it (`coalesce_read_zm`). + let said = |s: &Session, mark| { + s.notices_since(mark).iter().any(|n| { + n.text.contains("its geometry has no Z or M values") || (stream && n.text.contains(&rustgis_data::zm_note(Some(1)))) + }) + }; assert!(said(&s, mark), "stream {stream}: {:?}", s.notices_since(mark)); assert!(std::fs::read_to_string(&out).unwrap().contains("[1.0,2.0]")); let mark = s.notice_mark();