From: Rico Tzschichholz Date: Sat, 22 Sep 2018 08:42:55 +0000 (+0200) Subject: tests: Add invalid "object creation" tests to increase coverage X-Git-Tag: 0.43.1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dc710ec2b2030e18ab0c2e067e48ac830d864a9;p=thirdparty%2Fvala.git tests: Add invalid "object creation" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index acbb59986..4cd23bb4b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -575,6 +575,10 @@ TESTS = \ semantic/method-too-many-type-arguments.test \ semantic/method-virtual.test \ semantic/method-virtual-body.test \ + semantic/objectcreation-abstract-class.test \ + semantic/objectcreation-no-creation-method.test \ + semantic/objectcreation-non-public-constructor.test \ + semantic/objectcreation-unsupported-type.test \ semantic/parameter-accessibility.test \ semantic/parameter-default-type.test \ semantic/parameter-out-default.test \ diff --git a/tests/semantic/objectcreation-abstract-class.test b/tests/semantic/objectcreation-abstract-class.test new file mode 100644 index 000000000..37234b5e5 --- /dev/null +++ b/tests/semantic/objectcreation-abstract-class.test @@ -0,0 +1,8 @@ +Invalid Code + +abstract class Foo { +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/semantic/objectcreation-no-creation-method.test b/tests/semantic/objectcreation-no-creation-method.test new file mode 100644 index 000000000..17195fa31 --- /dev/null +++ b/tests/semantic/objectcreation-no-creation-method.test @@ -0,0 +1,8 @@ +Invalid Code + +void bar () { +} + +void main () { + var foo = new Foo.bar (); +} diff --git a/tests/semantic/objectcreation-non-public-constructor.test b/tests/semantic/objectcreation-non-public-constructor.test new file mode 100644 index 000000000..aa5ce3a57 --- /dev/null +++ b/tests/semantic/objectcreation-non-public-constructor.test @@ -0,0 +1,10 @@ +Invalid Code + +class Foo { + Foo () { + } +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/semantic/objectcreation-unsupported-type.test b/tests/semantic/objectcreation-unsupported-type.test new file mode 100644 index 000000000..163f71c51 --- /dev/null +++ b/tests/semantic/objectcreation-unsupported-type.test @@ -0,0 +1,9 @@ +Invalid Code + +enum Bar { + NONE +} + +void main () { + var foo = new Bar (); +}