ref: f762f96f07cf2dfc7b3bb745d6a767dccda0a01a
dir: /lib/std/test/dirname.myr/
use std const main = { eq(std.dirname("foo/bar"), "foo") eq(std.dirname("/foo/bar"), "/foo") eq(std.dirname("/foo/bar/"), "/foo") eq(std.dirname("/bar/"), "/") eq(std.dirname("/"), "/") eq(std.dirname("///"), "/") eq(std.basename("foo/bar"), "bar") eq(std.basename("/foo/bar"), "bar") eq(std.basename("/foo/bar/"), "bar") eq(std.basename("/bar/"), "bar") eq(std.basename("/"), "") eq(std.basename("///"), "") } const eq = {a, e if !std.eq(e, a) std.fatal("expected '{}', got '{}'\n", e, a) ;; }