test: io: add directory deletion test

This commit is contained in:
2025-08-09 19:41:57 +01:00
parent 8bdb770ae5
commit 13cb866892

25
io-test/rmdir.c Normal file
View File

@@ -0,0 +1,25 @@
#include <blue/io/directory.h>
int main(int argc, const char **argv)
{
if (argc < 2) {
return -1;
}
const char *path = argv[1];
b_directory *dir;
b_result result = b_directory_open(NULL, B_RV_PATH(path), 0, &dir);
if (b_result_is_error(result)) {
b_throw(result);
return -1;
}
result = b_directory_delete(dir);
if (b_result_is_error(result)) {
b_throw(result);
return -1;
}
return 0;
}