System.FilePath.parent did not return the correct parent path in the case of absolute file paths Example of previous behavior ``` (FilePath.mk "/foo").parent -> some (FilePath.mk "") (System.FilePath.mk "/").parent -> some (FilePath.mk "") ``` The new behavior is based on rust's std::path::Path::parent function (as previously described in comment in System.FilePath) Example of updated behavior ``` (System.FilePath.mk "/foo").parent -> some (FilePath.mk "/") (System.FilePath.mk "/").parent -> none ``` Behavior for relative file paths is unchanged Closes #3618
28 lines
241 B
Text
28 lines
241 B
Text
true
|
|
false
|
|
"a/b"
|
|
"a/b/c"
|
|
"/b/c"
|
|
some "a"
|
|
some "a/b"
|
|
none
|
|
some "/a/b"
|
|
some "/"
|
|
some "/"
|
|
none
|
|
true
|
|
true
|
|
true
|
|
true
|
|
some "b"
|
|
some "b"
|
|
some "b.tar"
|
|
some ".gitignore"
|
|
"a/c"
|
|
none
|
|
some "txt"
|
|
none
|
|
"a/b.tar.xz"
|
|
"a/b.tar"
|
|
"a/b.tar.gz"
|
|
"a/b.tar.gz.bak"
|