aboutsummaryrefslogtreecommitdiffstats
path: root/test-files
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-10 00:22:26 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-10 00:22:26 +0100
commit135e40c12e99f97b667bdd561192ea44dd4ebd9e (patch)
tree68c1921593a748daceebe390d2ed98a90b5dc205 /test-files
parentmds-kbdc: m bug fixes + more test cases (diff)
downloadmds-135e40c12e99f97b667bdd561192ea44dd4ebd9e.tar.gz
mds-135e40c12e99f97b667bdd561192ea44dd4ebd9e.tar.bz2
mds-135e40c12e99f97b667bdd561192ea44dd4ebd9e.tar.xz
mds-kbdc: compile-layout: m + more test cases
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'test-files')
-rw-r--r--test-files/mds-kbdc/compile-layout/invalid/invalid_call_to_builtin_function3
-rw-r--r--test-files/mds-kbdc/compile-layout/invalid/invalid_calls_to_set_3_and_get_224
-rw-r--r--test-files/mds-kbdc/compile-layout/valid/builtin_functions62
-rw-r--r--test-files/mds-kbdc/compile-layout/valid/call_to_builtin_function_with_empty_arguments2
4 files changed, 91 insertions, 0 deletions
diff --git a/test-files/mds-kbdc/compile-layout/invalid/invalid_call_to_builtin_function b/test-files/mds-kbdc/compile-layout/invalid/invalid_call_to_builtin_function
new file mode 100644
index 0000000..a3079e8
--- /dev/null
+++ b/test-files/mds-kbdc/compile-layout/invalid/invalid_call_to_builtin_function
@@ -0,0 +1,3 @@
+"" : "\add("" 1)"
+"" : "\sub(1 "")"
+
diff --git a/test-files/mds-kbdc/compile-layout/invalid/invalid_calls_to_set_3_and_get_2 b/test-files/mds-kbdc/compile-layout/invalid/invalid_calls_to_set_3_and_get_2
new file mode 100644
index 0000000..c5cedc6
--- /dev/null
+++ b/test-files/mds-kbdc/compile-layout/invalid/invalid_calls_to_set_3_and_get_2
@@ -0,0 +1,24 @@
+let \2 : ""
+let \3 : {}
+let \4 : { "0" }
+"" : "\set(0 0 0)"
+"" : "\get(0 0)"
+"" : "\set(1 0 0)"
+"" : "\get(1 0)"
+"" : "\set(2 0 0)"
+"" : "\get(2 0)"
+"" : "\set(3 0 0)"
+"" : "\get(3 0)"
+"" : "\set(4 1 0)"
+"" : "\get(4 1)"
+"" : "\set("" 0 0)"
+"" : "\get("" 0)"
+"" : "\set("a" 0 0)"
+"" : "\get("a" 0)"
+"" : "\set("aa" 0 0)"
+"" : "\get("aa" 0)"
+"" : "\set(1 "" 0)"
+"" : "\get(1 "")"
+"" : "\set(1 "aa" 0)"
+"" : "\get(1 "aa")"
+
diff --git a/test-files/mds-kbdc/compile-layout/valid/builtin_functions b/test-files/mds-kbdc/compile-layout/valid/builtin_functions
new file mode 100644
index 0000000..c818472
--- /dev/null
+++ b/test-files/mds-kbdc/compile-layout/valid/builtin_functions
@@ -0,0 +1,62 @@
+if \not(\equals(\add(1 2) 3))
+ "" : 0
+end if
+if \not(\equals(\sub(5 3) 2))
+ "" : 0
+end if
+if \not(\equals(\mul(2 3) 6))
+ "" : 0
+end if
+if \not(\equals(\div(8 2) 4))
+ "" : 0
+end if
+if \not(\equals(\mod(14 4) 2))
+ "" : 0
+end if
+if \not(\equals(\rsh(1024 2) 256))
+ "" : 0
+end if
+if \not(\equals(\lsh(1 10) 1024))
+ "" : 0
+end if
+if \not(\equals(\or(7 9) 15))
+ "" : 0
+end if
+if \not(\equals(\and(15 5) 5))
+ "" : 0
+end if
+if \not(\equals(\xor(15 21) 26))
+ "" : 0
+end if
+if \not(1)
+ "" : 0
+end if
+if \not(0)
+else
+ "" : 0
+end if
+if \not(\equals(0 0))
+ "" : 0
+end if
+if \equals(0 1)
+ "" : 0
+end if
+if \not(\greater(2 1))
+ "" : 0
+end if
+if \greater(2 2)
+ "" : 0
+end if
+if \greater(2 3)
+ "" : 0
+end if
+if \not(\less(1 2))
+ "" : 0
+end if
+if \less(2 2)
+ "" : 0
+end if
+if \less(3 2)
+ "" : 0
+end if
+
diff --git a/test-files/mds-kbdc/compile-layout/valid/call_to_builtin_function_with_empty_arguments b/test-files/mds-kbdc/compile-layout/valid/call_to_builtin_function_with_empty_arguments
new file mode 100644
index 0000000..783ec25
--- /dev/null
+++ b/test-files/mds-kbdc/compile-layout/valid/call_to_builtin_function_with_empty_arguments
@@ -0,0 +1,2 @@
+"\add("" "")" : "\not("")"
+