MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / lift_memory_prefers_memory_container

Function lift_memory_prefers_memory_container

atomic-canonical/src/memory.rs:309–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307
308 #[test]
309 fn lift_memory_prefers_memory_container() {
310 // With a :::memory container, its body is authoritative and the
311 // surrounding prose is ignored (single authoring site).
312 let body = "\
313ignored surrounding prose
314
315:::memory{}
316The constraint text that is authoritative.
317:::
318
319more ignored prose";
320 let node = lift_memory(&fm(), body).unwrap();
321 assert_eq!(node.text, "The constraint text that is authoritative.");
322 assert!(!node.text.contains("ignored"));
323
324 // Without a container, the whole trimmed body is the text.
325 let plain = lift_memory(&fm(), " just a plain body ").unwrap();
326 assert_eq!(plain.text, "just a plain body");
327 }
328
329 #[test]
330 fn lift_memory_accepts_kind_alias_and_defaults_status() {

Callers

nothing calls this directly

Calls 3

lift_memoryFunction · 0.85
fmFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected