aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2020-12-30 22:44:25 -0800
committerOmar Rizwan <omar@omar.website>2020-12-30 22:44:25 -0800
commit957ea5a3d43152c0f7a77e88e8d094e9578c0726 (patch)
treec2fc4fd086efab52fcd52445b54f854ea87a2162 /test
parentb09951ebc20ddf7291029aafc8f1280fdfac59d2 (diff)
console and execute-script work. with test
Diffstat (limited to 'test')
-rw-r--r--test/test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test.c b/test/test.c
index b9f34b7..d16c724 100644
--- a/test/test.c
+++ b/test/test.c
@@ -31,7 +31,7 @@ int matches_regex(char* str, char* pattern) {
// integration tests
int main() {
// TODO: invoke over extension
- assert(system("node ../extension/background.js --unhandled-rejections=strict") == 0); // run quick local JS tests
+ /* assert(system("node ../extension/background.js --unhandled-rejections=strict") == 0); // run quick local JS tests */
// reload the extension so we know it's the latest code.
system("echo reload > ../fs/mnt/runtime/reload 2>/dev/null"); // this may error, but it should still have effect
@@ -50,6 +50,7 @@ int main() {
usleep(10000);
assert(times++ < 10000);
}
+
assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0);
}
@@ -69,6 +70,14 @@ int main() {
}
assert(system("cat ../fs/mnt/tabs/last-focused/debugger/scripts/*test-script.js") == 0);
+ {
+ FILE* console = fopen("../fs/mnt/tabs/last-focused/console", "r");
+ assert(system("echo \"console.log('hi')\" > ../fs/mnt/tabs/last-focused/execute-script") == 0);
+ char hi[3] = {0}; fread(hi, 1, 2, console);
+ assert(strcmp(hi, "hi") == 0);
+ fclose(console);
+ }
+
assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0);
}