From 8315efcb604fcf6002af99f7dd4303e2ac149047 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Tue, 29 Dec 2020 04:27:12 -0800 Subject: improve scripts dir -- checking scriptId more reliably. add tests --- test/test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 #include #include +#include +#include #include #include @@ -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); } -- cgit v1.2.3