Closed chanced closed 1 month ago
This test is also failing:
let base = PointerBuf::must_parse("/a");
let suffix_0 = PointerBuf::must_parse("/");
let suffix_1 = PointerBuf::must_parse("/suffix_1");
let mut a = base.clone();
a.append(&suffix_0);
let mut b = base.clone();
b.append(&suffix_1);
let isect = a.intersection(&b);
assert_eq!(
isect, base,
"intersection failed\n\n expected: \"{base}\"\n actual: \"{isect}\""
);
expected: "/a"
actual: "/a/"
left: Pointer("/a/")
right: PointerBuf("/a")
@asmello I dont know how easily this can be solved with the current logic. We may need to loop through the tokens, comparing them instead of comparing bytes.
Ah, I see the problem... Comparing tokens is probably the way to go, though the case where one of the pointers is root needs special care. Thankfully this is now fairly efficient, since Tokens are borrowed.
I have it partially working using comparison on the "add-tests"
branch (pr #48). There's a case that's failing but I don't immediately recognize why.
edit: (above was fixed)
This test is also failing: