()
| 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() { |
nothing calls this directly
no test coverage detected