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



commit 0005fc7fd9fa9f25dff9ef1c4bf7d54135a01349
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 549c90231..87b21b353 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -728,6 +728,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]