Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pkgs/o/os.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/os/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "os-tests"
version = "0.1.0"

[dependencies.mcpplibs]
os = "0.1.0"
os = "0.1.1"

[indices]
mcpplibs = { path = "../../.." }
6 changes: 6 additions & 0 deletions tests/examples/os/tests/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading