test: add lots of stream tests

This commit is contained in:
2025-06-27 21:54:10 +01:00
parent c987f34693
commit 86d5b9d31d
4 changed files with 57 additions and 2 deletions

18
object-test/streams.c Normal file
View File

@@ -0,0 +1,18 @@
#include <blue/core/stream.h>
#include <blue/object/string.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
size_t nr_read = 0;
b_string *str = b_string_create();
b_stream *dest_stream;
b_stream_pipeline *pipeline;
b_status status = b_string_open_stream(str, &dest_stream);
b_stream_pipeline_create(1024, &pipeline);
b_stream_read_all_bytes_s(b_stdin, dest_stream, pipeline, &nr_read);
printf("done. read %zu bytes total.\n", nr_read);
printf("%s\n", b_string_ptr(str));
return 0;
}