MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_storage_system_path_errors

Function test_storage_system_path_errors

std/src/storage/mod.rs:1250–1268  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 1

attachMethod · 0.80

Tested by

no test coverage detected