mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
19 lines
435 B
Plaintext
19 lines
435 B
Plaintext
module std::io @test;
|
|
|
|
fn void test_writing()
|
|
{
|
|
DString foo;
|
|
foo.init(mem);
|
|
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");
|
|
}
|