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:287–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285
286 #[test]
287 fn lift_memory_prefers_memory_container() {
288 // With a :::memory container, its body is authoritative and the
289 // surrounding prose is ignored (single authoring site).
290 let body = "\
291ignored surrounding prose
292
293:::memory{}
294The constraint text that is authoritative.
295:::
296
297more ignored prose";
298 let node = lift_memory(&fm(), body).unwrap();
299 assert_eq!(node.text, "The constraint text that is authoritative.");
300 assert!(!node.text.contains("ignored"));
301
302 // Without a container, the whole trimmed body is the text.
303 let plain = lift_memory(&fm(), " just a plain body ").unwrap();
304 assert_eq!(plain.text, "just a plain body");
305 }
306
307 #[test]
308 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