auto dataDirsGuard = EnvGuard("XDG_DATA_DIRS"); auto newDataDirs = ["/usr/local/data", "/usr/data"]; environment["XDG_DATA_DIRS"] = "/usr/local/data:/usr/data:/usr/local/data/:/usr/data/"; assert(xdgDataDirs() == newDataDirs); assert(equal(xdgDataDirs("applications"), newDataDirs.map!(p => buildPath(p, "applications")))); environment.remove("XDG_DATA_DIRS"); assert(xdgDataDirs() == ["/usr/local/share", "/usr/share"]); assert(equal(xdgDataDirs("icons"), ["/usr/local/share", "/usr/share"].map!(p => buildPath(p, "icons"))));