diff options
author | Omar Rizwan <omar@omar.website> | 2020-12-22 16:36:09 -0800 |
---|---|---|
committer | Omar Rizwan <omar@omar.website> | 2020-12-22 16:36:09 -0800 |
commit | de9a792a2113ca48458d5142f2cd06353419793c (patch) | |
tree | 7131e9c79377f09a8f6ffedac56b6c2f17ccc365 /test.c | |
parent | 9e23fc59fc8fb3ee94aca07e2a2f7fa5d309df06 (diff) |
start adding extensions/ folder. fix up js tests
some hacks to start working on clearing old scriptParsed entries
Diffstat (limited to 'test.c')
-rwxr-xr-x | test.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -8,14 +8,14 @@ #include <assert.h> int file_contents_equal(char* path, char* contents) { - char command[200]; - snprintf(command, sizeof(command), - "[ \"%s\" == \"$(cat %s)\" ]", contents, path); - return system(command) == 0; + // hehe: https://twitter.com/ianh_/status/1340450349065244675 + setenv("path", path, 1); + setenv("contents", contents, 1); + return system("[ \"$contents\" == \"$(cat \"$path\")\" ]") == 0; } // integration tests -int main(int argc, char** argv) { +int main() { assert(system("echo about:blank > fs/mnt/tabs/create") == 0); assert(file_contents_equal("fs/mnt/tabs/last-focused/url", "about:blank")); assert(system("file fs/mnt/tabs/last-focused/screenshot.png") == 0); |