]> 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>
Tue, 19 Oct 2021 07:48:27 +0000 (09:48 +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 bdd0bd4bf4e0586383e472c5862430c953cb47f5..20d581550f349e0e07a48b09afe07ed54172bae3 100644 (file)
@@ -965,6 +965,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 \
@@ -1074,6 +1076,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 () {
+}