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

Function test_header_json_roundtrip

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

Source from the content-addressed store, hash-verified

650
651 #[test]
652 fn test_header_json_roundtrip() {
653 let header = ChangeHeader::builder()
654 .message("Test message")
655 .description("Detailed description")
656 .author(Author::new("Alice", Some("alice@example.com")))
657 .build();
658
659 let json = serde_json::to_string(&header).unwrap();
660 let parsed: ChangeHeader = serde_json::from_str(&json).unwrap();
661
662 assert_eq!(header.message, parsed.message);
663 assert_eq!(header.description, parsed.description);
664 assert_eq!(header.authors.len(), parsed.authors.len());
665 }
666
667 #[test]
668 fn test_header_json_minimal() {

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