ref: 705f2d8c1f2d2b9f68ea7ef30af3b43d69a64b6a
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/../.."))
}