[vala/0.48] tests: Add some "unary expressions" tests to increase coverage



commit dd102fdae9858b823711e1aa766a29daaf6b455c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Feb 27 12:23:56 2021 +0100

    tests: Add some "unary expressions" tests to increase coverage

 tests/Makefile.am                                     |  2 ++
 .../unary-invalid-instance-member-access.test         |  9 +++++++++
 tests/semantic/unary-unsupported-out-ref.test         | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 413493533..04e03f170 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1043,10 +1043,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/yield-call-requires-async-context.test \
        semantic/yield-call-requires-async-method.test \
        semantic/yield-call-requires-async-method-2.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);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]