aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 1ff917d0..87eab8c6 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3404,6 +3404,35 @@ Exiting setjmp function, level: 0, prev_jmp: -1
'''
self.do_run(src, 'z:1*', force_c=True)
+ def test_rename(self):
+ src = '''
+ #include <stdio.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <assert.h>
+
+ int main() {
+ int err;
+ FILE* fid;
+
+ err = mkdir("/foo", 0777);
+ err = mkdir("/bar", 0777);
+ fid = fopen("/foo/bar", "w+");
+ fclose(fid);
+
+ err = rename("/foo/bar", "/foo/bar2");
+ printf("%d\\n", err);
+
+ err = rename("/foo", "/foo/foo");
+ printf("%d\\n", err);
+
+ err = rename("/foo", "/bar/foo");
+ printf("%d\\n", err);
+ return 0;
+ }
+ '''
+ self.do_run(src, '0\n-1\n0\n', force_c=True)
+
def test_alloca_stack(self):
if self.emcc_args is None: return # too slow in other modes