[vala/0.46] tests: Add more "parser" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.46] tests: Add more "parser" tests to increase coverage
- Date: Wed, 5 Feb 2020 10:04:51 +0000 (UTC)
commit 57c093c27ec0a4ae2120ba3e46d599ea7c93cc7e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Jan 30 13:42:43 2020 +0100
tests: Add more "parser" tests to increase coverage
tests/Makefile.am | 2 ++
tests/parser/declaration-embedded.test | 6 ++++++
tests/parser/member-access-pointer.vala | 12 ++++++++++++
3 files changed, 20 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5cf2966bf..c5b57e100 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -591,6 +591,7 @@ TESTS = \
parser/creation-no-new.test \
parser/creation-no-override.test \
parser/creation-no-virtual.test \
+ parser/declaration-embedded.test \
parser/delegate-anonymous.test \
parser/delegate-no-new.test \
parser/destructor-class-exists.test \
@@ -612,6 +613,7 @@ TESTS = \
parser/invalid-brace.test \
parser/lock-statement.vala \
parser/main-block.vala \
+ parser/member-access-pointer.vala \
parser/method-no-abstract-override.test \
parser/method-no-abstract-virtual-override.test \
parser/method-no-abstract-virtual.test \
diff --git a/tests/parser/declaration-embedded.test b/tests/parser/declaration-embedded.test
new file mode 100644
index 000000000..f39cbbd95
--- /dev/null
+++ b/tests/parser/declaration-embedded.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+ if (true)
+ var i = 42;
+}
diff --git a/tests/parser/member-access-pointer.vala b/tests/parser/member-access-pointer.vala
new file mode 100644
index 000000000..b3a0c5e4d
--- /dev/null
+++ b/tests/parser/member-access-pointer.vala
@@ -0,0 +1,12 @@
+struct Foo {
+ public int i;
+
+ public void bar<G,T> (G g, T t) {
+ }
+}
+
+void main () {
+ Foo foo = { 42 };
+
+ (&foo)->bar<int?, string> (23, "foo");
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]