meta: re-organise tests

This commit is contained in:
2026-05-04 16:37:06 +01:00
parent 716b939d4f
commit 18c9d30c60
40 changed files with 161 additions and 25 deletions
+26
View File
@@ -0,0 +1,26 @@
#include <fx/core/stream.h>
#include <fx/io/file.h>
#include <fx/io/path.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
fx_file *dest;
fx_path *path = fx_path_create_from_cstr("data.txt");
fx_result result = fx_file_open(
NULL, path, FX_FILE_WRITE_ONLY | FX_FILE_CREATE, &dest);
if (fx_result_is_error(result)) {
fx_throw(result);
return -1;
}
size_t nr_read = 0;
fx_stream_buffer *buf = fx_stream_buffer_create_dynamic(1024);
fx_stream_read_all_bytes_s(fx_stdin, dest, buf, &nr_read);
printf("done. read %zu bytes total.\n", nr_read);
fx_path_unref(path);
fx_file_unref(dest);
return 0;
}