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

Function test_file_metadata_byte_roundtrip

atomic-core/src/record/item.rs:885–900  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

883
884 #[test]
885 fn test_file_metadata_byte_roundtrip() {
886 let metas = [
887 FileMetadata::regular_file(),
888 FileMetadata::executable(),
889 FileMetadata::directory(),
890 FileMetadata::new(0o600, false),
891 FileMetadata::new(0o700, true),
892 ];
893
894 for meta in metas {
895 let byte = meta.to_byte();
896 let decoded = FileMetadata::from_byte(byte);
897 assert_eq!(meta.is_dir(), decoded.is_dir());
898 assert_eq!(meta.is_executable(), decoded.is_executable());
899 }
900 }
901
902 #[test]
903 fn test_file_metadata_default() {

Callers

nothing calls this directly

Calls 1

to_byteMethod · 0.45

Tested by

no test coverage detected