From d5adda2f716d20efc3e83e368f3837e2ef6db300 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sun, 14 Apr 2019 18:03:50 +0200 Subject: [PATCH] tests: Add "postcondition with local result" test to increase coverage --- tests/Makefile.am | 1 + tests/methods/postcondition-local-result.vala | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/methods/postcondition-local-result.vala 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"); +} -- 2.47.2