From ff1b90a4f4aec4d374261adda460ddc1d83c5ddd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 1 Dec 2014 20:26:07 +0100 Subject: mds-kbdc: m + more test cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .../mds-kbdc/validate-tree/invalid/for-return | 13 ++++++ .../mds-kbdc/validate-tree/invalid/if-else-break | 22 +++++++++++ .../validate-tree/invalid/misplaced_assumption | 46 ++++++++++++++++++++++ .../validate-tree/invalid/misplaced_information | 38 ++++++++++++++++++ .../mds-kbdc/validate-tree/invalid/runaway_break | 7 ++++ .../validate-tree/invalid/runaway_continue | 7 ++++ 6 files changed, 133 insertions(+) create mode 100644 test-files/mds-kbdc/validate-tree/invalid/for-return create mode 100644 test-files/mds-kbdc/validate-tree/invalid/if-else-break create mode 100644 test-files/mds-kbdc/validate-tree/invalid/misplaced_assumption create mode 100644 test-files/mds-kbdc/validate-tree/invalid/misplaced_information create mode 100644 test-files/mds-kbdc/validate-tree/invalid/runaway_break create mode 100644 test-files/mds-kbdc/validate-tree/invalid/runaway_continue (limited to 'test-files/mds-kbdc/validate-tree/invalid') 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 +have_chars " " +have_range "a" "z" +information + have + have_chars " " + have_range "a" "z" +end information + +# (have (@ 1 0-4) +# (.data +# (keys (@ 1 5-12) ‘’) +# ) +# ) +# (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) ‘’) +# ) +# ) +# (have_chars (@ 6 2-12) ‘" "’) +# (have_range (@ 7 2-12) ‘"a"’ ‘"z"’) +# ) +# ) +# :1:0–4: error: assumption outside assumption clause +# have +# ^^^^ +# :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 +# ^^^^ +# :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 +# ^^^^^^^^ + -- cgit v1.2.3-70-g09d2