[vala/0.40] tests: Add "property accessor with try statement" test to increase coverage



commit ab3348b958848f3a760e1573b26a573a97e34048
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Aug 10 11:56:47 2020 +0200

    tests: Add "property accessor with try statement" test to increase coverage

 tests/Makefile.am           |  1 +
 tests/errors/bug627090.vala | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7e54ce1a5..6f2ec7b9b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -463,6 +463,7 @@ TESTS = \
        errors/bug579101.vala \
        errors/bug596228.vala \
        errors/bug623049.vala \
+       errors/bug627090.vala \
        errors/bug639589.vala \
        errors/bug651145.vala \
        errors/bug762377.vala \
diff --git a/tests/errors/bug627090.vala b/tests/errors/bug627090.vala
new file mode 100644
index 000000000..19ddb3d18
--- /dev/null
+++ b/tests/errors/bug627090.vala
@@ -0,0 +1,20 @@
+class Foo : Object {
+       public string bar {
+               owned get {
+                       try {
+                               return manam ();
+                       } catch (Error e) {
+                               assert_not_reached ();
+                       }
+               }
+       }
+}
+
+string manam () throws Error {
+       return "manam";
+}
+
+void main () {
+       var foo = new Foo ();
+       assert (foo.bar == "manam");
+}


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