[vala/0.48] tests: Add more invalid "member access" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] tests: Add more invalid "member access" tests to increase coverage
- Date: Tue, 19 Oct 2021 08:00:25 +0000 (UTC)
commit 43a873115d934763af82708402365d3069b5f0d0
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Oct 18 12:23:21 2021 +0200
tests: Add more invalid "member access" tests to increase coverage
tests/Makefile.am | 3 +++
tests/delegates/lambda-outer-constant.test | 11 +++++++++++
tests/semantic/member-access-not-found.test | 9 +++++++++
tests/semantic/member-access-this-invalid.test | 5 +++++
4 files changed, 28 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 759bb8cfb..016143342 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -408,6 +408,7 @@ TESTS = \
delegates/instance-method-to-no-target-2.test \
delegates/lambda-incompatible.test \
delegates/lambda-mixed-instance-static.vala \
+ delegates/lambda-outer-constant.test \
delegates/lambda-shared-closure.vala \
delegates/member-target-destroy.vala \
delegates/reference_transfer.vala \
@@ -1006,7 +1007,9 @@ TESTS = \
semantic/member-access-capture-out.test \
semantic/member-access-capture-valist-parameter.test \
semantic/member-access-capture-valist-variable.test \
+ semantic/member-access-not-found.test \
semantic/member-access-protected-invalid.test \
+ semantic/member-access-this-invalid.test \
semantic/member-access-undefined.test \
semantic/member-access-static-with-instance.vala \
semantic/member-access-static-transformed-qualified.vala \
diff --git a/tests/delegates/lambda-outer-constant.test b/tests/delegates/lambda-outer-constant.test
new file mode 100644
index 000000000..51251fa06
--- /dev/null
+++ b/tests/delegates/lambda-outer-constant.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+delegate void FooFunc ();
+
+void main () {
+ const int FOO = 23;
+
+ FooFunc foo = () => {
+ var i = FOO;
+ };
+}
diff --git a/tests/semantic/member-access-not-found.test b/tests/semantic/member-access-not-found.test
new file mode 100644
index 000000000..8fb096fda
--- /dev/null
+++ b/tests/semantic/member-access-not-found.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+class Foo {
+}
+
+void main () {
+ var foo = new Foo ();
+ foo.get_bar ();
+}
diff --git a/tests/semantic/member-access-this-invalid.test b/tests/semantic/member-access-this-invalid.test
new file mode 100644
index 000000000..39162245b
--- /dev/null
+++ b/tests/semantic/member-access-this-invalid.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+ var foo = this;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]