summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAnton L. Šijanec <sijanecantonluka@gmail.com>2020-05-16 19:35:55 +0200
committerAnton L. Šijanec <sijanecantonluka@gmail.com>2020-05-16 19:35:55 +0200
commit587f44fd93a0024500418ce25bf01d0f177644f4 (patch)
tree13a981e5bc369cca8cc99ad9547d54b4c76673f5 /test
parentfix to allow nested commands (diff)
downloadbverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.gz
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.bz2
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.lz
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.xz
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.zst
bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.zip
Diffstat (limited to 'test')
-rw-r--r--test/inarray-test.c16
-rw-r--r--test/joinarray.c13
-rw-r--r--test/tape-test.bvr5
3 files changed, 31 insertions, 3 deletions
diff --git a/test/inarray-test.c b/test/inarray-test.c
new file mode 100644
index 0000000..21cb1d1
--- /dev/null
+++ b/test/inarray-test.c
@@ -0,0 +1,16 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+#include <inarray.c>
+extern int main(int argc, char* argv[]) {
+ if(argc != 3) {
+ printf("%s c string\n", argv[0]);
+ return 1;
+ }
+ if(char_in_array(argv[1][0], argv[2])) {
+ printf("%c is in %s\n", argv[1][0], argv[2]);
+ } else {
+ printf("%c is NOT in %s\n", argv[1][0], argv[2]);
+ }
+ return 0;
+}
diff --git a/test/joinarray.c b/test/joinarray.c
new file mode 100644
index 0000000..5c81a65
--- /dev/null
+++ b/test/joinarray.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+#include <joinarrays.c>
+// do not use this, it is idiotic, you have strlcpy!
+extern int main(int argc, char* argv[]) {
+ char a1[3] = {1, 2, 3};
+ char a2[5] = {4, 5, 6, 7, 8};
+ int * joined = join_null_terminated_arrays(a1, a2);
+ joined[8] = '\n';
+ fprintf(stdout, "%ld\n", joined);
+ return 0;
+}
diff --git a/test/tape-test.bvr b/test/tape-test.bvr
index 0ae5679..85e9f58 100644
--- a/test/tape-test.bvr
+++ b/test/tape-test.bvr
@@ -1,4 +1,3 @@
<@?i assets/content/global.bvr @>
-<@?s testing krnkeni@>
-<@?s abcdefghijklmnopr ?i krnkeni@>
-<@?g abcdefghijklmnopr@>
+<@?s testing krneki@>
+<@?u -2 -1 ?g testing @>