diff --git a/pkgs/o/os.lua b/pkgs/o/os.lua index 6bb851a5..e7f12c89 100644 --- a/pkgs/o/os.lua +++ b/pkgs/o/os.lua @@ -17,8 +17,19 @@ package = { repo = "https://github.com/mcpplibs/os", type = "package", + extensions = { + autoupdate = { + tag = "${version}", + url = "https://github.com/mcpplibs/os/archive/refs/tags/${tag}.tar.gz", + }, + }, + xpm = { linux = { + ["0.1.1"] = { + url = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.1.tar.gz", + sha256 = "c5abfb625ded0d5d837b799722c836c302460251d47081fef7a57a2a12e6b2b9", + }, ["0.1.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.0.tar.gz", @@ -28,6 +39,10 @@ package = { }, }, macosx = { + ["0.1.1"] = { + url = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.1.tar.gz", + sha256 = "c5abfb625ded0d5d837b799722c836c302460251d47081fef7a57a2a12e6b2b9", + }, ["0.1.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.0.tar.gz", @@ -37,6 +52,10 @@ package = { }, }, windows = { + ["0.1.1"] = { + url = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.1.tar.gz", + sha256 = "c5abfb625ded0d5d837b799722c836c302460251d47081fef7a57a2a12e6b2b9", + }, ["0.1.0"] = { url = { GLOBAL = "https://github.com/mcpplibs/os/archive/refs/tags/0.1.0.tar.gz", diff --git a/tests/examples/os/mcpp.toml b/tests/examples/os/mcpp.toml index 90a02f63..ba244646 100644 --- a/tests/examples/os/mcpp.toml +++ b/tests/examples/os/mcpp.toml @@ -6,7 +6,7 @@ name = "os-tests" version = "0.1.0" [dependencies.mcpplibs] -os = "0.1.0" +os = "0.1.1" [indices] mcpplibs = { path = "../../.." } diff --git a/tests/examples/os/tests/os.cpp b/tests/examples/os/tests/os.cpp index 978a1610..76cdc9d3 100644 --- a/tests/examples/os/tests/os.cpp +++ b/tests/examples/os/tests/os.cpp @@ -21,6 +21,12 @@ int main(int argc, char** argv) { check(!os::fs::publish(file, "second").has_value(), "a published name is not replaced"); check(os::fs::read(file).value_or("") == "first", "and keeps what was published first"); + // 0.1.1: a name the Windows code page cannot spell, both ways (UTF-8 throughout). + const std::string name = "\xE4\xB8\xAD\xE6\x96\x87 \xD0\xBA\xD0\xB8\xD1\x80.txt"; + const auto wide = dir / os::fs::from_utf8(name); + check(os::fs::write(wide, "ok").has_value() && os::fs::read(wide).value_or("") == "ok", "a file whose name is not ASCII"); + check(os::fs::utf8(wide.filename()) == name, "and its name reads back as UTF-8"); + const char sep = os::conventions().path_list_separator; const auto parts = os::env::split_list(std::string("a") + sep + sep + "b"); check(parts.size() == 2, "a list of directories splits at the host's separator");