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.40.24~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab3348b958848f3a760e1573b26a573a97e34048;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 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"); +}