From: Rico Tzschichholz Date: Wed, 13 Jun 2018 15:16:38 +0000 (+0200) Subject: tests: Add invalid "type-argument" tests to increase coverage X-Git-Tag: 0.41.90~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01cd665d35ee81b906c45f65fafd127c012a2d5a;p=thirdparty%2Fvala.git tests: Add invalid "type-argument" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index c05a68d51..0ebea0658 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -461,11 +461,15 @@ TESTS = \ parser/yield-method.test \ parser/bug728574.vala \ parser/bug749576.vala \ + semantic/class-too-few-type-arguments.test \ + semantic/class-too-many-type-arguments.test \ semantic/constant-extern.test \ semantic/constant-value.test \ semantic/constant-value-missing.test \ semantic/constant-value-type.test \ semantic/constant-void.test \ + semantic/delegate-too-few-type-arguments.test \ + semantic/delegate-too-many-type-arguments.test \ semantic/field-accessibility.test \ semantic/field-compact-static.test \ semantic/field-external.test \ @@ -510,6 +514,8 @@ TESTS = \ semantic/method-private-virtual.test \ semantic/method-protected.test \ semantic/method-return-accessibility.test \ + semantic/method-too-few-type-arguments.test \ + semantic/method-too-many-type-arguments.test \ semantic/method-virtual.test \ semantic/method-virtual-body.test \ semantic/parameter-accessibility.test \ diff --git a/tests/semantic/class-too-few-type-arguments.test b/tests/semantic/class-too-few-type-arguments.test new file mode 100644 index 000000000..7ff295f4e --- /dev/null +++ b/tests/semantic/class-too-few-type-arguments.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/semantic/class-too-many-type-arguments.test b/tests/semantic/class-too-many-type-arguments.test new file mode 100644 index 000000000..55674b32d --- /dev/null +++ b/tests/semantic/class-too-many-type-arguments.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/semantic/delegate-too-few-type-arguments.test b/tests/semantic/delegate-too-few-type-arguments.test new file mode 100644 index 000000000..a232a86c5 --- /dev/null +++ b/tests/semantic/delegate-too-few-type-arguments.test @@ -0,0 +1,7 @@ +Invalid Code + +delegate void FooFunc (G g, T t); + +void main () { + FooFunc foo = (g, t) => {}; +} diff --git a/tests/semantic/delegate-too-many-type-arguments.test b/tests/semantic/delegate-too-many-type-arguments.test new file mode 100644 index 000000000..153e0551e --- /dev/null +++ b/tests/semantic/delegate-too-many-type-arguments.test @@ -0,0 +1,7 @@ +Invalid Code + +delegate void FooFunc (); + +void main () { + FooFunc foo = () => {}; +} diff --git a/tests/semantic/method-too-few-type-arguments.test b/tests/semantic/method-too-few-type-arguments.test new file mode 100644 index 000000000..95499900d --- /dev/null +++ b/tests/semantic/method-too-few-type-arguments.test @@ -0,0 +1,8 @@ +Invalid Code + +void bar (G g, T t) { +} + +void main () { + bar ("foo", 42); +} diff --git a/tests/semantic/method-too-many-type-arguments.test b/tests/semantic/method-too-many-type-arguments.test new file mode 100644 index 000000000..e43cfa31d --- /dev/null +++ b/tests/semantic/method-too-many-type-arguments.test @@ -0,0 +1,8 @@ +Invalid Code + +void bar (string s, int i) { +} + +void main () { + bar ("foo", 42); +}