Added tests for stdlib subroutine `strlen`.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 7 Aug 2019 19:47:14 +0000 (12:47 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 7 Aug 2019 19:47:14 +0000 (12:47 -0700)
stdlib_tests/4001_strlen.pvvs [new file with mode: 0644]
stdlib_tests/vv_test.py

diff --git a/stdlib_tests/4001_strlen.pvvs b/stdlib_tests/4001_strlen.pvvs
new file mode 100644 (file)
index 0000000..7c0e0af
--- /dev/null
@@ -0,0 +1,14 @@
+A"Hello World"
+SSSTSSSSSN      | PUSH 32 (address)
+SSSTSTTN        | PUSH 11 (count)
+NSTTTTTTN       | JSR > 11111 (spew)
+
+SSSTSSSSSN      | PUSH 32 (address)
+NSTTSSSSSN      | JSR > 100000 (strlen)
+NSTTSSTN        | JSR > 1001 (print number from stack)
+
+NNN             | DIE
+
+#include <stdio.pvvs>
+#include <heap.pvvs>
+#include <string.pvvs>
index 368a166..a121659 100755 (executable)
@@ -36,6 +36,7 @@ tests = [
         ['3004_and', '', '+0+0+1+1+42'],
         ['3005_or', '', '+0+1+1-1-1'],
         ['3006_xor', '', '+0+1+0-2-1'],
         ['3004_and', '', '+0+0+1+1+42'],
         ['3005_or', '', '+0+1+1-1-1'],
         ['3006_xor', '', '+0+1+0-2-1'],
+        ['4001_strlen', '', '+11'],
         ] 
 
 for test in tests:
         ] 
 
 for test in tests: