Files
c3c/test/unit/stdlib/io/dstringstream.c3
Christoffer Lerno c4212c4649 - Test runner will also check for leaks.
- `write` of qoi would leak memory.
- Issue when having an empty `Path` or just "."
- `set_env` would leak memory.
2025-02-10 00:39:02 +01:00

19 lines
436 B
Plaintext

module std::io @test;
fn void test_writing()
{
DString foo;
foo.new_init();
defer foo.free();
OutStream s = &foo;
s.write("hello")!!;
s.write_byte('-')!!;
s.write("what?-------------------------------------------------------")!!;
ByteReader r;
String test_str = "2134";
io::copy_to(r.init(test_str), s)!!;
String o = foo.str_view();
assert(o == "hello-what?-------------------------------------------------------2134");
}