mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add dstringwriter.
This commit is contained in:
17
test/unit/stdlib/io/dstringstream.c3
Normal file
17
test/unit/stdlib/io/dstringstream.c3
Normal file
@@ -0,0 +1,17 @@
|
||||
module std::io @test;
|
||||
|
||||
fn void! test_writing()
|
||||
{
|
||||
DString foo;
|
||||
foo.init();
|
||||
Stream s = foo.as_stream();
|
||||
s.write("hello")!!;
|
||||
s.write_byte('-')!!;
|
||||
s.write("what?")!!;
|
||||
ByteReader r;
|
||||
String test_str = "2134";
|
||||
r.init(test_str);
|
||||
s.read_from(&&r.as_stream())?;
|
||||
String o = foo.str();
|
||||
assert(o == "hello-what?2134");
|
||||
}
|
||||
Reference in New Issue
Block a user