From: Rico Tzschichholz Date: Mon, 10 Aug 2020 09:56:47 +0000 (+0200) Subject: tests: Add "property accessor with try statement" test to increase coverage X-Git-Tag: 0.46.13~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cd3439756a5d044aabf69274576dbeee5508758;p=thirdparty%2Fvala.git tests: Add "property accessor with try statement" test to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 7b0bd74ae..e758e6d2f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -516,6 +516,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"); +}