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

Function test_header_json_full_roundtrip

atomic-core/src/change/header.rs:678–692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676
677 #[test]
678 fn test_header_json_full_roundtrip() {
679 let header = ChangeHeader::builder()
680 .message("Full JSON test")
681 .description("Testing full JSON serialization")
682 .author(Author::new("Alice", Some("alice@example.com")))
683 .author(Author::new("Bob", None::<String>))
684 .build();
685
686 let json = serde_json::to_string_pretty(&header).unwrap();
687 let parsed: ChangeHeader = serde_json::from_str(&json).unwrap();
688
689 assert_eq!(header.message, parsed.message);
690 assert_eq!(header.description, parsed.description);
691 assert_eq!(header.authors.len(), parsed.authors.len());
692 }
693
694 // Builder Tests
695

Callers

nothing calls this directly

Calls 5

authorMethod · 0.80
buildMethod · 0.45
descriptionMethod · 0.45
messageMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected