]> 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 11:49:04 +0000 (13:49 +0200)
tests/Makefile.am
tests/errors/bug627090.vala [new file with mode: 0644]

index 12c90bf0b505c44025012c9cae1ca7c35b1d1cd7..e1bfc0625b2a0f045fbfd00e013dd4d8361093b0 100644 (file)
@@ -545,6 +545,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");
+}