]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add more "type-arguments" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Oct 2021 07:15:58 +0000 (09:15 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Oct 2021 07:15:58 +0000 (09:15 +0200)
tests/Makefile.am
tests/semantic/field-too-few-type-arguments.test [new file with mode: 0644]
tests/semantic/field-too-many-type-arguments.test [new file with mode: 0644]
tests/semantic/property-too-few-type-arguments.test [new file with mode: 0644]
tests/semantic/property-too-many-type-arguments.test [new file with mode: 0644]

index b135ba95f8f7606694d41cb5df7f76c9e2c12841..2541eb97ff038d7f2f335011f89ca4e2e34a0078 100644 (file)
@@ -1019,6 +1019,8 @@ TESTS = \
        semantic/field-non-constant.test \
        semantic/field-owned-to-unowned.test \
        semantic/field-static-instance-access.test \
+       semantic/field-too-few-type-arguments.test \
+       semantic/field-too-many-type-arguments.test \
        semantic/field-valist.test \
        semantic/field-void.test \
        semantic/floating-reference.vala \
@@ -1128,6 +1130,8 @@ TESTS = \
        semantic/property-struct-override.test \
        semantic/property-struct-protected.test \
        semantic/property-struct-virtual.test \
+       semantic/property-too-few-type-arguments.test \
+       semantic/property-too-many-type-arguments.test \
        semantic/property-void.test \
        semantic/reference-transfer-not-supported.test \
        semantic/reference-transfer-unavailable.test \
diff --git a/tests/semantic/field-too-few-type-arguments.test b/tests/semantic/field-too-few-type-arguments.test
new file mode 100644 (file)
index 0000000..150b049
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+class Foo<G,T> {
+}
+
+Foo<string> bar;
+
+void main () {
+}
diff --git a/tests/semantic/field-too-many-type-arguments.test b/tests/semantic/field-too-many-type-arguments.test
new file mode 100644 (file)
index 0000000..a26a799
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+class Foo<G> {
+}
+
+Foo<string,int> bar;
+
+void main () {
+}
diff --git a/tests/semantic/property-too-few-type-arguments.test b/tests/semantic/property-too-few-type-arguments.test
new file mode 100644 (file)
index 0000000..e0c0fa7
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo<G,T> {
+}
+
+class Bar {
+       public Foo<string> foo { get; set; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-too-many-type-arguments.test b/tests/semantic/property-too-many-type-arguments.test
new file mode 100644 (file)
index 0000000..ff83264
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo<G> {
+}
+
+class Bar {
+       public Foo<string,int> foo { get; set; }
+}
+
+void main () {
+}