diff options
author | Omar Rizwan <omar@omar.website> | 2020-12-22 20:34:01 -0800 |
---|---|---|
committer | Omar Rizwan <omar@omar.website> | 2020-12-22 20:34:01 -0800 |
commit | 35214c9698e54e107ad1f28f9fce6da6b00ed39a (patch) | |
tree | fafd4bd7ef06be352448fe49a6380256b5ee8550 /test.c | |
parent | e6f9ce7437d8f83076680391be0d260f80a018c3 (diff) |
extensions/*/enabled is readable (+ test that works)
Diffstat (limited to 'test.c')
-rwxr-xr-x | test.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -6,6 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> +#include <wordexp.h> int file_contents_equal(char* path, char* contents) { // hehe: https://twitter.com/ianh_/status/1340450349065244675 @@ -14,12 +15,19 @@ int file_contents_equal(char* path, char* contents) { return system("[ \"$contents\" == \"$(cat \"$path\")\" ]") == 0; } +char* expand(char* phrase) { + wordexp_t result; assert(wordexp(phrase, &result, 0) == 0); + return result.we_wordv[0]; +} + // integration tests 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); + /* assert(system("file fs/mnt/tabs/last-focused/screenshot.png") == 0); */ assert(system("echo remove > fs/mnt/tabs/last-focused/control") == 0); + assert(file_contents_equal(expand("fs/mnt/extensions/TabFS*/enabled"), "true")); + assert(1); printf("Done!\n"); } |