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

Function test_postcard_roundtrip

atomic-core/src/change/encoding.rs:529–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527
528 #[test]
529 fn test_postcard_roundtrip() {
530 for encoding in [
531 Encoding::Utf8,
532 Encoding::Utf16Le,
533 Encoding::Utf16Be,
534 Encoding::Latin1,
535 Encoding::Binary,
536 ] {
537 let bytes = postcard::to_allocvec(&encoding).unwrap();
538 let parsed: Encoding = postcard::from_bytes(&bytes).unwrap();
539 assert_eq!(encoding, parsed);
540 }
541 }
542
543 // Edge Cases
544

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected