# * the validity of the path is not checked
#
# assert "some/./complex/../../path/from/../to/a////file//".simplify_path == "path/to/a/file"
- # assert "../dir/file".simplify_path == "../dir/file"
- # assert "dir/../../".simplify_path == ".."
- # assert "//absolute//path/".simplify_path == "/absolute/path"
+ # assert "../dir/file".simplify_path == "../dir/file"
+ # assert "dir/../../".simplify_path == ".."
+ # assert "dir/..".simplify_path == "."
+ # assert "//absolute//path/".simplify_path == "/absolute/path"
fun simplify_path: String
do
var a = self.split_with("/")
end
a2.push(x)
end
+ if a2.is_empty then return "."
return a2.join("/")
end