From: Rico Tzschichholz Date: Sat, 27 Feb 2021 11:23:56 +0000 (+0100) Subject: tests: Add some "unary expressions" tests to increase coverage X-Git-Tag: 0.51.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d5f3eefac6df8c009fca0b7243d66dcad3465ce;p=thirdparty%2Fvala.git tests: Add some "unary expressions" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ea1cb3fb..fe064e2f8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1080,10 +1080,12 @@ TESTS = \ semantic/throw-no-error-type.test \ semantic/throw-unknown-error-type.test \ semantic/type-argument-ownership-mismatch.test \ + semantic/unary-invalid-instance-member-access.test \ semantic/unary-unsupported-complement.test \ semantic/unary-unsupported-increment.test \ semantic/unary-unsupported-minus.test \ semantic/unary-unsupported-negation.test \ + semantic/unary-unsupported-out-ref.test \ semantic/with-array.test \ semantic/with-buildin.vala \ semantic/with-class.test \ diff --git a/tests/semantic/unary-invalid-instance-member-access.test b/tests/semantic/unary-invalid-instance-member-access.test new file mode 100644 index 000000000..7e857867f --- /dev/null +++ b/tests/semantic/unary-invalid-instance-member-access.test @@ -0,0 +1,9 @@ +Invalid Code + +class Foo { + public bool bar; +} + +void main () { + assert (!Foo.bar); +} diff --git a/tests/semantic/unary-unsupported-out-ref.test b/tests/semantic/unary-unsupported-out-ref.test new file mode 100644 index 000000000..21f2ba64c --- /dev/null +++ b/tests/semantic/unary-unsupported-out-ref.test @@ -0,0 +1,19 @@ +Invalid Code + +class Foo { + public string bar { get; set; } +} + +void manam (out string s) { + s = "manam"; +} + +void minim (ref string s) { + s = "minim"; +} + +void main () { + var foo = new Foo (); + manam (out foo.bar); + minim (ref foo.bar); +}