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

Function test_storage_make_canonical_ok

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

Source from the content-addressed store, hash-verified

849
850 #[test]
851 fn test_storage_make_canonical_ok() {
852 let mut storage = Storage::default();
853 storage.mount("some", "memory://").unwrap();
854
855 assert_eq!("MEMORY:/", storage.make_canonical("memory:").unwrap());
856
857 assert_eq!("MEMORY:foo.bar", storage.make_canonical("foo.bar").unwrap());
858 assert_eq!("MEMORY:/foo.bar", storage.make_canonical("/foo.bar").unwrap());
859 storage.cd("some:/").unwrap();
860 assert_eq!("SOME:foo.bar", storage.make_canonical("foo.bar").unwrap());
861 assert_eq!("SOME:/foo.bar", storage.make_canonical("/foo.bar").unwrap());
862
863 assert_eq!("MEMORY:a", storage.make_canonical("memory:a").unwrap());
864 assert_eq!("MEMORY:/Abc", storage.make_canonical("memory:/Abc").unwrap());
865 assert_eq!("OTHER:a", storage.make_canonical("Other:a").unwrap());
866 assert_eq!("OTHER:/Abc", storage.make_canonical("Other:/Abc").unwrap());
867 }
868
869 #[test]
870 fn test_storage_make_canonical_errors() {

Callers

nothing calls this directly

Calls 2

mountMethod · 0.80
cdMethod · 0.80

Tested by

no test coverage detected