test: move all module tests to the test/ directory

This commit is contained in:
2025-11-01 10:12:18 +00:00
parent a68b9f7ba7
commit bd2fe50ec9
32 changed files with 5 additions and 5 deletions

32
test/io/tree.c Normal file
View File

@@ -0,0 +1,32 @@
#include <blue/io/directory.h>
#include <stdio.h>
#define NRAND_NUMBERS 12
#define NRAND_BYTES 128
#define NRAND_DOUBLES 8
int main(int argc, const char **argv)
{
if (argc < 2) {
return -1;
}
b_directory *dir = NULL;
b_path *path = b_path_create_from_cstr(argv[1]);
b_result result = b_directory_open(B_DIRECTORY_ROOT, path, 0, &dir);
if (b_result_is_error(result)) {
b_throw(result);
return -1;
}
b_iterator *it = b_directory_begin(dir, B_DIRECTORY_ITERATE_PARENT_FIRST);
b_foreach(b_directory_entry *, entry, it)
{
printf("%s\n", b_path_ptr(entry->filepath));
}
b_iterator_unref(it);
return 0;
}