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

Function empty_scope_files_emit_no_key

atomic-canonical/src/lift.rs:597–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

595
596 #[test]
597 fn empty_scope_files_emit_no_key() {
598 // Hash back-compat: a scope item with no file-refs must serialize to
599 // exactly the pre-existing key-set (`files` is skipped when empty), so
600 // existing fixtures keep their content/substance hash.
601 let body = ":::scope-out\nSome prose boundary.\n:::";
602 let node = lift_intent(&fm(), body).unwrap();
603 let item = &node.has_scope_out[0];
604 assert!(item.files.is_empty());
605
606 let v = serde_json::to_value(item).unwrap();
607 let keys: Vec<&str> = v.as_object().unwrap().keys().map(String::as_str).collect();
608 assert_eq!(keys, vec!["@id", "@type", "text"]);
609 }
610
611 #[test]
612 fn empty_verifications_and_required_kinds_emit_no_keys() {

Callers

nothing calls this directly

Calls 5

lift_intentFunction · 0.85
keysMethod · 0.80
fmFunction · 0.70
unwrapMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected