Files
c3c/test/unit/stdlib/io/dstringstream.c3
Christoffer Lerno 9a6d83f526 Updated stream API.
2023-09-03 01:14:15 +02:00

17 lines
427 B
C

module std::io @test;
fn void! test_writing()
{
DString foo;
foo.init();
Stream* s = DStringStream{}.init(&foo);
s.write("hello")!!;
s.write_byte('-')!!;
s.write("what?-------------------------------------------------------")!!;
ByteReader r;
String test_str = "2134";
s.read_from(r.init(test_str))!;
String o = foo.as_str();
assert(o == "hello-what?-------------------------------------------------------2134");
}