INNER CODE UNIT · Rust
rejects_ambiguous_destinations_and_invalid_paths
XayahSuSuSu/Android-DataBackup · source-next/native/src/main/jni/rustic/src/mapped_source.rs:467
fn rejects_ambiguous_destinations_and_invalid_paths() {
let workspace = Workspace::new();
workspace.write("parent/existing/file", "old");
workspace.write("other/file", "new");
for target in ["data", "data/existing"] {
assert!(
MappedSource::new(&[
workspace.mapping("parent", "data"),
workspace.mapping("other", target),
])
.is_err()
);
}
for target in ["", "../escape", "data/../escape"] {
assert!(MappedSource::new(&[workspace.mapping("parent", target)]).is_err());
}
assert!(MappedSource::new(&[workspace.mapping("other/file", "/")]).is_err());
assert!(