diff options
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/methods/postcondition-local-result.vala | 8 |
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"); +} |