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

Function test_memory_error_display

atomic-core/src/output/memory.rs:1094–1125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1092
1093 #[test]
1094 fn test_memory_error_display() {
1095 let err = MemoryError::NotFound {
1096 path: "test.txt".to_string(),
1097 };
1098 assert!(err.to_string().contains("test.txt"));
1099 assert!(err.to_string().contains("not found"));
1100
1101 let err = MemoryError::NotADirectory {
1102 path: "file.txt".to_string(),
1103 };
1104 assert!(err.to_string().contains("Not a directory"));
1105
1106 let err = MemoryError::IsADirectory {
1107 path: "dir".to_string(),
1108 };
1109 assert!(err.to_string().contains("Is a directory"));
1110
1111 let err = MemoryError::PermissionDenied {
1112 path: "secret".to_string(),
1113 };
1114 assert!(err.to_string().contains("Permission denied"));
1115
1116 let err = MemoryError::AlreadyExists {
1117 path: "existing".to_string(),
1118 };
1119 assert!(err.to_string().contains("Already exists"));
1120
1121 let err = MemoryError::DirectoryNotEmpty {
1122 path: "notempty".to_string(),
1123 };
1124 assert!(err.to_string().contains("not empty"));
1125 }
1126
1127 #[test]
1128 fn test_memory_error_debug() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected