| 1209 | |
| 1210 | #[test] |
| 1211 | fn test_storage_system_path_ok() { |
| 1212 | let dir = tempfile::tempdir().unwrap(); |
| 1213 | let dir = dir.path().canonicalize().unwrap(); |
| 1214 | |
| 1215 | let mut storage = Storage::default(); |
| 1216 | storage |
| 1217 | .attach( |
| 1218 | "c", |
| 1219 | &format!("file://{}", dir.display()), |
| 1220 | Box::from(DirectoryDrive::new(dir.clone()).unwrap()), |
| 1221 | ) |
| 1222 | .unwrap(); |
| 1223 | |
| 1224 | assert!(storage.system_path("memory:/foo").unwrap().is_none()); |
| 1225 | assert_eq!(dir.join("some name"), storage.system_path("c:/some name").unwrap().unwrap()); |
| 1226 | assert_eq!(dir.join("xyz"), storage.system_path("c:xyz").unwrap().unwrap()); |
| 1227 | } |
| 1228 | |
| 1229 | #[test] |
| 1230 | fn test_storage_system_path_of_cwd() { |