]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "property accessor with try statement" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 10 Aug 2020 09:56:47 +0000 (11:56 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 10 Aug 2020 12:03:59 +0000 (14:03 +0200)
tests/Makefile.am
tests/errors/bug627090.vala [new file with mode: 0644]

index 7e54ce1a50dfc65a1e4ce23ab94ec0ebe5efa070..6f2ec7b9b1698844a8da54258a4fea2daaf73561 100644 (file)
@@ -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 (file)
index 0000000..19ddb3d
--- /dev/null
@@ -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");
+}