From: Luca Bruno Date: Tue, 11 Jun 2013 20:59:14 +0000 (+0200) Subject: Add testcase for missed postconditions in methods returning void X-Git-Tag: 0.21.1~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3c2589cf39f9dd6efcb403e47c68e1b0fba76d5;p=thirdparty%2Fvala.git Add testcase for missed postconditions in methods returning void --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 8392c677a..06ca778d4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -36,6 +36,7 @@ TESTS = \ namespaces.vala \ methods/lambda.vala \ methods/closures.vala \ + methods/prepostconditions.vala \ methods/symbolresolution.vala \ methods/bug595538.vala \ methods/bug596726.vala \ diff --git a/tests/methods/prepostconditions.vala b/tests/methods/prepostconditions.vala new file mode 100644 index 000000000..871bfa7fe --- /dev/null +++ b/tests/methods/prepostconditions.vala @@ -0,0 +1,12 @@ +class Foo { + public bool ensured = false; + + public void foo () ensures (ensured = true) { + } +} + +void main () { + var foo = new Foo(); + foo.foo(); + assert(foo.ensured); +} \ No newline at end of file