| 1248 | |
| 1249 | #[test] |
| 1250 | fn test_storage_system_path_errors() { |
| 1251 | let dir = tempfile::tempdir().unwrap(); |
| 1252 | let dir = dir.path(); |
| 1253 | |
| 1254 | let mut storage = Storage::default(); |
| 1255 | storage |
| 1256 | .attach( |
| 1257 | "c", |
| 1258 | &format!("file://{}", dir.display()), |
| 1259 | Box::from(DirectoryDrive::new(dir).unwrap()), |
| 1260 | ) |
| 1261 | .unwrap(); |
| 1262 | |
| 1263 | assert_eq!( |
| 1264 | "Too many / separators in path 'c:a/b'", |
| 1265 | format!("{}", storage.system_path("c:a/b").unwrap_err()) |
| 1266 | ); |
| 1267 | assert_eq!("Invalid path 'c:..'", format!("{}", storage.system_path("c:..").unwrap_err())); |
| 1268 | } |
| 1269 | } |