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.49.90~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42207a5da23b4b4c4fe1afff999bd4cd593a6447;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 12c90bf0b..e1bfc0625 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 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"); +}