aboutsummaryrefslogtreecommitdiffstats
path: root/test-files
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-01 20:26:07 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-01 20:26:07 +0100
commitff1b90a4f4aec4d374261adda460ddc1d83c5ddd (patch)
tree356865160bad344c8c19b9c1d115d7574f75e005 /test-files
parentmds-kbdc: add some test cases + fix issued with inclusion (diff)
downloadmds-ff1b90a4f4aec4d374261adda460ddc1d83c5ddd.tar.gz
mds-ff1b90a4f4aec4d374261adda460ddc1d83c5ddd.tar.bz2
mds-ff1b90a4f4aec4d374261adda460ddc1d83c5ddd.tar.xz
mds-kbdc: 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/validate-tree/invalid/for-return13
-rw-r--r--test-files/mds-kbdc/validate-tree/invalid/if-else-break22
-rw-r--r--test-files/mds-kbdc/validate-tree/invalid/misplaced_assumption46
-rw-r--r--test-files/mds-kbdc/validate-tree/invalid/misplaced_information38
-rw-r--r--test-files/mds-kbdc/validate-tree/invalid/runaway_break7
-rw-r--r--test-files/mds-kbdc/validate-tree/invalid/runaway_continue7
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/assumption18
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/for-break10
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/for-continue10
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/for-for-end-break15
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/function-return10
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/information14
-rw-r--r--test-files/mds-kbdc/validate-tree/valid/macro-return10
13 files changed, 220 insertions, 0 deletions
diff --git a/test-files/mds-kbdc/validate-tree/invalid/for-return b/test-files/mds-kbdc/validate-tree/invalid/for-return
new file mode 100644
index 0000000..af59736
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/for-return
@@ -0,0 +1,13 @@
+for 1 to 9 as \1
+ return
+end for
+
+# (for (@ 1 0-3) ‘1’ ‘9’ (.variable ‘\1’)
+# (.inner
+# (return (@ 2 2-8))
+# )
+# )
+# :2:2–8: error: ‘return’ outside function and macro definition
+# return
+# ^^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/invalid/if-else-break b/test-files/mds-kbdc/validate-tree/invalid/if-else-break
new file mode 100644
index 0000000..0e8ae81
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/if-else-break
@@ -0,0 +1,22 @@
+if 1
+ if 0
+ else
+ break
+ end if
+end if
+
+# (if (@ 1 0-2) ‘1’
+# (.inner
+# (if (@ 2 2-4) ‘0’
+# (.inner nil)
+# (.otherwise
+# (break (@ 4 4-9))
+# )
+# )
+# )
+# (.otherwise nil)
+# )
+# :4:4–9: error: ‘break’ outside ‘for’
+# break
+# ^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/invalid/misplaced_assumption b/test-files/mds-kbdc/validate-tree/invalid/misplaced_assumption
new file mode 100644
index 0000000..904ffd5
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/misplaced_assumption
@@ -0,0 +1,46 @@
+have <space>
+have_chars " "
+have_range "a" "z"
+information
+ have <space>
+ have_chars " "
+ have_range "a" "z"
+end information
+
+# (have (@ 1 0-4)
+# (.data
+# (keys (@ 1 5-12) ‘<space>’)
+# )
+# )
+# (have_chars (@ 2 0-10) ‘" "’)
+# (have_range (@ 3 0-10) ‘"a"’ ‘"z"’)
+# (information (@ 4 0-11)
+# (.inner
+# (have (@ 5 2-6)
+# (.data
+# (keys (@ 5 7-14) ‘<space>’)
+# )
+# )
+# (have_chars (@ 6 2-12) ‘" "’)
+# (have_range (@ 7 2-12) ‘"a"’ ‘"z"’)
+# )
+# )
+# :1:0–4: error: assumption outside assumption clause
+# have <space>
+# ^^^^
+# :2:0–10: error: assumption outside assumption clause
+# have_chars " "
+# ^^^^^^^^^^
+# :3:0–10: error: assumption outside assumption clause
+# have_range "a" "z"
+# ^^^^^^^^^^
+# :5:2–6: error: assumption outside assumption clause
+# have <space>
+# ^^^^
+# :6:2–12: error: assumption outside assumption clause
+# have_chars " "
+# ^^^^^^^^^^
+# :7:2–12: error: assumption outside assumption clause
+# have_range "a" "z"
+# ^^^^^^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/invalid/misplaced_information b/test-files/mds-kbdc/validate-tree/invalid/misplaced_information
new file mode 100644
index 0000000..248a212
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/misplaced_information
@@ -0,0 +1,38 @@
+language ""
+country ""
+variant ""
+assumption
+ language ""
+ country ""
+ variant ""
+end assumption
+
+# (language (@ 1 0-8) ‘""’)
+# (country (@ 2 0-7) ‘""’)
+# (variant (@ 3 0-7) ‘""’)
+# (assumption (@ 4 0-10)
+# (.inner
+# (language (@ 5 2-10) ‘""’)
+# (country (@ 6 2-9) ‘""’)
+# (variant (@ 7 2-9) ‘""’)
+# )
+# )
+# :1:0–8: error: information outside information clause
+# language ""
+# ^^^^^^^^
+# :2:0–7: error: information outside information clause
+# country ""
+# ^^^^^^^
+# :3:0–7: error: information outside information clause
+# variant ""
+# ^^^^^^^
+# :5:2–10: error: information outside information clause
+# language ""
+# ^^^^^^^^
+# :6:2–9: error: information outside information clause
+# country ""
+# ^^^^^^^
+# :7:2–9: error: information outside information clause
+# variant ""
+# ^^^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/invalid/runaway_break b/test-files/mds-kbdc/validate-tree/invalid/runaway_break
new file mode 100644
index 0000000..0e9911d
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/runaway_break
@@ -0,0 +1,7 @@
+break
+
+# (break (@ 1 0-5))
+# :1:0–5: error: ‘break’ outside ‘for’
+# break
+# ^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/invalid/runaway_continue b/test-files/mds-kbdc/validate-tree/invalid/runaway_continue
new file mode 100644
index 0000000..a68b7e4
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/invalid/runaway_continue
@@ -0,0 +1,7 @@
+continue
+
+# (continue (@ 1 0-8))
+# :1:0–8: error: ‘continue’ outside ‘for’
+# continue
+# ^^^^^^^^
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/assumption b/test-files/mds-kbdc/validate-tree/valid/assumption
new file mode 100644
index 0000000..b8db1af
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/assumption
@@ -0,0 +1,18 @@
+assumption
+ have <space>
+ have_chars " "
+ have_range "a" "z"
+end assumption
+
+# (assumption (@ 1 0-10)
+# (.inner
+# (have (@ 2 2-6)
+# (.data
+# (keys (@ 2 7-14) ‘<space>’)
+# )
+# )
+# (have_chars (@ 3 2-12) ‘" "’)
+# (have_range (@ 4 2-12) ‘"a"’ ‘"z"’)
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/for-break b/test-files/mds-kbdc/validate-tree/valid/for-break
new file mode 100644
index 0000000..2d726c3
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/for-break
@@ -0,0 +1,10 @@
+for 1 to 9 as \1
+ break
+end for
+
+# (for (@ 1 0-3) ‘1’ ‘9’ (.variable ‘\1’)
+# (.inner
+# (break (@ 2 2-7))
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/for-continue b/test-files/mds-kbdc/validate-tree/valid/for-continue
new file mode 100644
index 0000000..a8424b8
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/for-continue
@@ -0,0 +1,10 @@
+for 1 to 9 as \1
+ continue
+end for
+
+# (for (@ 1 0-3) ‘1’ ‘9’ (.variable ‘\1’)
+# (.inner
+# (continue (@ 2 2-10))
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/for-for-end-break b/test-files/mds-kbdc/validate-tree/valid/for-for-end-break
new file mode 100644
index 0000000..f910969
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/for-for-end-break
@@ -0,0 +1,15 @@
+for 1 to 9 as \1
+ for 1 to 9 as \2
+ end for
+ break
+end for
+
+# (for (@ 1 0-3) ‘1’ ‘9’ (.variable ‘\1’)
+# (.inner
+# (for (@ 2 2-5) ‘1’ ‘9’ (.variable ‘\2’)
+# (.inner nil)
+# )
+# (break (@ 4 2-7))
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/function-return b/test-files/mds-kbdc/validate-tree/valid/function-return
new file mode 100644
index 0000000..a534c37
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/function-return
@@ -0,0 +1,10 @@
+function f/0
+ return
+end function
+
+# (function (@ 1 0-8) ‘f/0’
+# (.inner
+# (return (@ 2 2-8))
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/information b/test-files/mds-kbdc/validate-tree/valid/information
new file mode 100644
index 0000000..9e2beac
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/information
@@ -0,0 +1,14 @@
+information
+ language ""
+ country ""
+ variant ""
+end information
+
+# (information (@ 1 0-11)
+# (.inner
+# (language (@ 2 2-10) ‘""’)
+# (country (@ 3 2-9) ‘""’)
+# (variant (@ 4 2-9) ‘""’)
+# )
+# )
+
diff --git a/test-files/mds-kbdc/validate-tree/valid/macro-return b/test-files/mds-kbdc/validate-tree/valid/macro-return
new file mode 100644
index 0000000..e29786d
--- /dev/null
+++ b/test-files/mds-kbdc/validate-tree/valid/macro-return
@@ -0,0 +1,10 @@
+macro m/0
+ return
+end macro
+
+# (macro (@ 1 0-5) ‘m/0’
+# (.inner
+# (return (@ 2 2-8))
+# )
+# )
+