diff --git a/crates/engine/tests/purge_prompts.rs b/crates/engine/tests/purge_prompts.rs index 9602c4f..408cd2c 100644 --- a/crates/engine/tests/purge_prompts.rs +++ b/crates/engine/tests/purge_prompts.rs @@ -3,6 +3,7 @@ use cadcraft_engine::Session; use cadcraft_engine::doc::EntityKind; +use cadcraft_engine::geom::Vec3; use serde_json::json; /// Unused: blocks U1 and U2, layer Spare, linetype DASHED, text style Notes, dimension style Arch. @@ -75,7 +76,9 @@ fn verify_asks_for_each_name_and_absent_types_take_their_tokens() { assert!(s.log[n..].iter().any(|l| l.contains("No unreferenced")), "{:?}", &s.log[n..]); assert_eq!(count(&s, |k| matches!(k, EntityKind::Line(_))), 1); // Zero-length geometry purges at once. - s.execute("line", &json!({ "points": [[3, 3], [3, 3]] })).unwrap(); + // (Drawn directly: the LINE command refuses coincident points, but files can hold them.) + let zero = EntityKind::Line(cadcraft_engine::doc::Line { a: Vec3::new(3.0, 3.0, 0.0), b: Vec3::new(3.0, 3.0, 0.0) }); + s.doc_mut().unwrap().add(&cadcraft_engine::doc::Space::Model, cadcraft_engine::doc::Common::default(), zero).unwrap(); s.script("-PURGE Z\n").unwrap(); assert!(s.running.is_none(), "{}", s.prompt_text()); assert_eq!(count(&s, |k| matches!(k, EntityKind::Line(_))), 1);