works by creating a file at a path in a directory called test, then appending ../test in its path, canonicalizing and comparing that to the original path.
This doesn't work because the directory in which the test is working might not be canonical.
Proposed fix: canonicalize both the original path and the modifed path and compare. Also, check file contents at canonicalized path.
This test:
canonicalize_ok_with_dotdot_if_paths_exist
works by creating a file at a path in a directory called test, then appending ../test in its path, canonicalizing and comparing that to the original path.
This doesn't work because the directory in which the test is working might not be canonical.
Proposed fix: canonicalize both the original path and the modifed path and compare. Also, check file contents at canonicalized path.