[vala/wip/printer] DON'T MERGE Add example AST test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/printer] DON'T MERGE Add example AST test
- Date: Thu, 9 Apr 2020 20:33:37 +0000 (UTC)
commit 9ae5de971d6f90961287e15441a264236a3ebd98
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Apr 9 21:06:13 2020 +0200
DON'T MERGE Add example AST test
tests/Makefile.am | 1 +
tests/ast/switch-statement.test | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 083b320fb..62c70ccfa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -637,6 +637,7 @@ TESTS = \
scanner/string-escape-x-digit-length.test \
scanner/string-escape-x-empty.test \
scanner/string-escape-x.vala \
+ ast/switch-statement.test \
parser/array-creation-invalid.test \
parser/assignment.vala \
parser/attribute-duplicate.test \
diff --git a/tests/ast/switch-statement.test b/tests/ast/switch-statement.test
new file mode 100644
index 000000000..cde411df8
--- /dev/null
+++ b/tests/ast/switch-statement.test
@@ -0,0 +1,36 @@
+AST
+
+Input:
+
+void case_with_list () {
+ int i = 1;
+ switch (i) {
+ case 0, 1, 2:
+ break;
+ default:
+ assert_not_reached ();
+ }
+}
+
+void main () {
+ case_with_list ();
+}
+
+Output:
+
+1.1 | 1.19 | ValaMethod
+1.24 | 9.1 | ValaBlock
+2.2 | 2.10 | ValaDeclarationStatement
+2.10 | 2.10 | ValaIntegerLiteral
+3.2 | 3.11 | ValaSwitchStatement
+3.10 | 3.10 | ValaMemberAccess
+4.7 | 4.7 | ValaIntegerLiteral
+4.10 | 4.10 | ValaIntegerLiteral
+4.13 | 4.13 | ValaIntegerLiteral
+5.3 | 5.7 | ValaBreakStatement
+7.3 | 7.23 | ValaExpressionStatement
+7.3 | 7.23 | ValaMethodCall
+11.1 | 11.9 | ValaMethod
+11.14 | 13.1 | ValaBlock
+12.2 | 12.18 | ValaExpressionStatement
+12.2 | 12.18 | ValaMethodCall
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]