aboutsummaryrefslogtreecommitdiffstats
path: root/test-files
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test-files/mds-kbdc/simplify-tree/invalid/macro_call_with_empty_alternation8
-rw-r--r--test-files/mds-kbdc/simplify-tree/valid/macro_call_with_singleton_alternation10
-rw-r--r--test-files/mds-kbdc/simplify-tree/valid/multiple_nothing_alternation_in_macro_call34
-rw-r--r--test-files/mds-kbdc/simplify-tree/valid/nested_alternations_in_macro_call29
4 files changed, 81 insertions, 0 deletions
diff --git a/test-files/mds-kbdc/simplify-tree/invalid/macro_call_with_empty_alternation b/test-files/mds-kbdc/simplify-tree/invalid/macro_call_with_empty_alternation
new file mode 100644
index 0000000..5532b22
--- /dev/null
+++ b/test-files/mds-kbdc/simplify-tree/invalid/macro_call_with_empty_alternation
@@ -0,0 +1,8 @@
+my_macro([])
+
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments nil)
+# )
+# :1:9–10: error: empty alternation
+# my_macro([])
+
diff --git a/test-files/mds-kbdc/simplify-tree/valid/macro_call_with_singleton_alternation b/test-files/mds-kbdc/simplify-tree/valid/macro_call_with_singleton_alternation
new file mode 100644
index 0000000..c005dea
--- /dev/null
+++ b/test-files/mds-kbdc/simplify-tree/valid/macro_call_with_singleton_alternation
@@ -0,0 +1,10 @@
+my_macro([1])
+
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 10-11) ‘1’)
+# )
+# )
+# :1:9–10: warning: singleton alternation
+# my_macro([1])
+
diff --git a/test-files/mds-kbdc/simplify-tree/valid/multiple_nothing_alternation_in_macro_call b/test-files/mds-kbdc/simplify-tree/valid/multiple_nothing_alternation_in_macro_call
new file mode 100644
index 0000000..ef35cea
--- /dev/null
+++ b/test-files/mds-kbdc/simplify-tree/valid/multiple_nothing_alternation_in_macro_call
@@ -0,0 +1,34 @@
+my_macro([1 . . . 2])
+
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 10-11) ‘1’)
+# )
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments nil)
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments nil)
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments nil)
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 18-19) ‘2’)
+# )
+# )
+# :1:14–15: warning: multiple ‘.’ inside an alternation
+# my_macro([1 . . . 2])
+# ^
+# :1:12–13: note: first ‘.’ was here
+# my_macro([1 . . . 2])
+# ^
+# :1:16–17: warning: multiple ‘.’ inside an alternation
+# my_macro([1 . . . 2])
+# ^
+# :1:12–13: note: first ‘.’ was here
+# my_macro([1 . . . 2])
+# ^
+
diff --git a/test-files/mds-kbdc/simplify-tree/valid/nested_alternations_in_macro_call b/test-files/mds-kbdc/simplify-tree/valid/nested_alternations_in_macro_call
new file mode 100644
index 0000000..d40a68d
--- /dev/null
+++ b/test-files/mds-kbdc/simplify-tree/valid/nested_alternations_in_macro_call
@@ -0,0 +1,29 @@
+my_macro([[1 2] [3 4]])
+
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 11-12) ‘1’)
+# )
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 13-14) ‘2’)
+# )
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 17-18) ‘3’)
+# )
+# )
+# (macro_call (@ 1 0-8) ‘my_macro’
+# (.arguments
+# (string (@ 1 19-20) ‘4’)
+# )
+# )
+# :1:10–11: warning: alternation inside alternation is unnecessary
+# my_macro([[1 2] [3 4]])
+# ^
+# :1:16–17: warning: alternation inside alternation is unnecessary
+# my_macro([[1 2] [3 4]])
+# ^
+