- Fix appending to c:\ or \ #2569.

This commit is contained in:
Christoffer Lerno
2025-11-09 21:45:19 +01:00
parent 52ececba37
commit eccc6700dc
3 changed files with 15 additions and 3 deletions

View File

@@ -1,5 +1,18 @@
module std::io::path @test;
fn void test_append()
{
Path p = path::new(mem, "/", POSIX)!!;
Path p2 = p.append(mem, "hello")!!;
test::eq(p2.str_view(), "/hello");
p.free();
p2.free();
p = path::new(mem, "c:\\", WIN32)!!;
p2 = p.append(mem, "hello")!!;
assert(p2.str_view() == "c:\\hello");
p.free();
p2.free();
}
fn void test_dot()
{
Path p = path::new(mem, ".")!!;