[vala/wip/issue/327: 16/27] Added parser tests for with statement



commit 70ea6463fd72e0ba51ff6c332eddf233348b1714
Author: Nick Schrader <nick schrader mailbox org>
Date:   Fri Apr 3 13:55:24 2020 -0300

    Added parser tests for with statement

 tests/Makefile.am                    | 4 ++++
 tests/parser/with-embedded.vala      | 4 ++++
 tests/parser/with-empty.vala         | 3 +++
 tests/parser/with-no-block.test      | 5 +++++
 tests/parser/with-no-expression.test | 5 +++++
 5 files changed, 21 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 452f9111d..717bd922b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -729,6 +729,10 @@ TESTS = \
        parser/using-ambiguous-reference.test \
        parser/using-directive.vala \
        parser/using-invalid-namespace.test \
+       parser/with-embedded.vala \
+       parser/with-empty.vala \
+       parser/with-no-block.test \
+       parser/with-no-expression.test \
        parser/yield-method.test \
        parser/yield-return.test \
        parser/yield-return.vala \
diff --git a/tests/parser/with-embedded.vala b/tests/parser/with-embedded.vala
new file mode 100644
index 000000000..7dd82d7ea
--- /dev/null
+++ b/tests/parser/with-embedded.vala
@@ -0,0 +1,4 @@
+void main() {
+    with(10)
+        assert (to_string() == "10");
+}
\ No newline at end of file
diff --git a/tests/parser/with-empty.vala b/tests/parser/with-empty.vala
new file mode 100644
index 000000000..1deb8ee9c
--- /dev/null
+++ b/tests/parser/with-empty.vala
@@ -0,0 +1,3 @@
+void main() {
+    with(10);
+}
diff --git a/tests/parser/with-no-block.test b/tests/parser/with-no-block.test
new file mode 100644
index 000000000..0711acb14
--- /dev/null
+++ b/tests/parser/with-no-block.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main() {
+    with(10)
+}
\ No newline at end of file
diff --git a/tests/parser/with-no-expression.test b/tests/parser/with-no-expression.test
new file mode 100644
index 000000000..4d771a995
--- /dev/null
+++ b/tests/parser/with-no-expression.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main() {
+    with() { }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]