ref: 008887ccd998a43db6980fa57f1e210ec26c4acf
dir: /test/stdpathnorm.myr/
use std const main = { /* untouched */ std.put("%s\n", std.pathnorm("foo")) std.put("%s\n", std.pathnorm("foo/bar")) std.put("%s\n", std.pathnorm("/foo/bar")) std.put("%s\n", std.pathnorm(".")) /* empty path becomes "." */ std.put("%s\n", std.pathnorm(".")) /* delete //, trailing / */ std.put("%s\n", std.pathnorm("foo/")) std.put("%s\n", std.pathnorm("foo//bar/baz")) std.put("%s\n", std.pathnorm("//foo//bar/")) /* delete '.' */ std.put("%s\n", std.pathnorm("foo/./bar")) std.put("%s\n", std.pathnorm("/foo/bar/.")) std.put("%s\n", std.pathnorm("./foo/bar/.")) /* elide '..' */ std.put("%s\n", std.pathnorm("/../foo/bar")) std.put("%s\n", std.pathnorm("../../foo/bar")) std.put("%s\n", std.pathnorm("foo/bar/..")) std.put("%s\n", std.pathnorm("foo/bar/../..")) std.put("%s\n", std.pathnorm("foo/../bar/../..")) std.put("%s\n", std.pathnorm("/foo/../bar/../..")) /* mix all of the above */ std.put("%s\n", std.pathnorm("/../foo//bar")) std.put("%s\n", std.pathnorm("..//../foo/bar")) std.put("%s\n", std.pathnorm("foo//./bar/..")) std.put("%s\n", std.pathnorm("foo/bar/.././..")) std.put("%s\n", std.pathnorm("//foo/../bar/../..")) std.put("%s\n", std.pathnorm("foo/../bar/../..")) }