Skip to content

Commit

Permalink
add test for creating directories at cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Nov 7, 2024
1 parent c9035d3 commit f9850d5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/wasix/create-dir-at-cwd/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>

int main() {
int status = EXIT_FAILURE;

const char *dirName1 = "test1";
if (mkdir(dirName1, 0755) != 0) {
goto end;
}

const char *dirName2 = "./test2";
if (mkdir(dirName2, 0755) != 0) {
goto end;
}

status = EXIT_SUCCESS;

end:
printf("%d", status);
return 0;
}
5 changes: 5 additions & 0 deletions tests/wasix/create-dir-at-cwd/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

$WASMER -q run main.wasm --dir . > output

rmdir test1 test2 2>/dev/null && printf "0" | diff -u output - 1>/dev/null

0 comments on commit f9850d5

Please sign in to comment.