summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-04-14 18:03:50 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-04-19 15:29:54 +0200
commitd5adda2f716d20efc3e83e368f3837e2ef6db300 (patch)
tree4c88d179ed50d99226a14879fd0f618477e58e75
parent05c8d02355701cc4ee53170e00e5ae8889ae78b9 (diff)
downloadvala-wip/code-transformer.tar.gz
tests: Add "postcondition with local result" test to increase coveragewip/code-transformer
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/methods/postcondition-local-result.vala8
2 files changed, 9 insertions, 0 deletions
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");
+}