diff options
author | Omar Rizwan <omar@omar.website> | 2020-12-29 04:27:12 -0800 |
---|---|---|
committer | Omar Rizwan <omar@omar.website> | 2020-12-29 04:27:12 -0800 |
commit | 8315efcb604fcf6002af99f7dd4303e2ac149047 (patch) | |
tree | a284f76c9c60fec4712125ba3c0e0cd0f5af10b8 /test | |
parent | 705b245be5ea7e69f04c1ab370962de054800bb0 (diff) |
improve scripts dir -- checking scriptId more reliably. add tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c index edb1c99..b5d0900 100644 --- a/test/test.c +++ b/test/test.c @@ -1,6 +1,8 @@ #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> +#include <dirent.h> +#include <string.h> #include <unistd.h> #include <assert.h> @@ -44,6 +46,14 @@ int main() { assert(system("ls ../fs/mnt/tabs/last-focused/debugger/scripts") == 0); + { + DIR* scripts = opendir("../fs/mnt/tabs/last-focused/debugger/scripts"); + assert(strcmp(readdir(scripts)->d_name, ".") == 0); + assert(strcmp(readdir(scripts)->d_name, "..") == 0); + assert(strcmp(readdir(scripts)->d_name, "7_file____Users_osnr_Code_tabfs_test_test-script.js") == 0); + closedir(scripts); + } + assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0); } |