From: Rico Tzschichholz Date: Sun, 14 Apr 2019 16:03:50 +0000 (+0200) Subject: tests: Add "postcondition with local result" test to increase coverage X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fwip%2Fcode-transformer;p=thirdparty%2Fvala.git tests: Add "postcondition with local result" test to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 0386292af..3fb9798e3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -99,6 +99,7 @@ TESTS = \ methods/closures.vala \ methods/contains.vala \ methods/iterator.vala \ + methods/postcondition-local-result.vala \ methods/prepostconditions.vala \ methods/same-name.vala \ methods/symbolresolution.vala \ diff --git a/tests/methods/postcondition-local-result.vala b/tests/methods/postcondition-local-result.vala new file mode 100644 index 000000000..f5b5f62f9 --- /dev/null +++ b/tests/methods/postcondition-local-result.vala @@ -0,0 +1,8 @@ +public string foo () ensures (result.length >= 3) { + string result = "bar"; + return result; +} + +void main () { + assert (foo () == "bar"); +}