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

Function test_file_metadata_bytes_roundtrip

atomic-core/src/output/traits.rs:784–798  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

782
783 #[test]
784 fn test_file_metadata_bytes_roundtrip() {
785 let test_cases = [
786 FileMetadata::file(),
787 FileMetadata::executable(),
788 FileMetadata::directory(),
789 FileMetadata::symlink(),
790 FileMetadata::file().with_permissions(0o600),
791 ];
792
793 for original in test_cases {
794 let bytes = original.to_bytes();
795 let recovered = FileMetadata::from_bytes(&bytes).expect("should decode");
796 assert_eq!(original, recovered);
797 }
798 }
799
800 #[test]
801 fn test_file_metadata_from_bytes_too_short() {

Callers

nothing calls this directly

Calls 2

with_permissionsMethod · 0.80
to_bytesMethod · 0.45

Tested by

no test coverage detected