diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-02-27 12:23:56 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-02-27 12:23:56 +0100 |
commit | 0d5f3eefac6df8c009fca0b7243d66dcad3465ce (patch) | |
tree | 6595503bf6837825f8f7cb4f3f633f6420c93892 | |
parent | ad9c0751574ec8f7c4fb55ba2f1fff383fc90d69 (diff) | |
download | vala-0d5f3eefac6df8c009fca0b7243d66dcad3465ce.tar.gz |
tests: Add some "unary expressions" tests to increase coverage
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/semantic/unary-invalid-instance-member-access.test | 9 | ||||
-rw-r--r-- | tests/semantic/unary-unsupported-out-ref.test | 19 |
3 files changed, 30 insertions, 0 deletions
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); +} |