]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Extent "post-condition" creation method test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 24 Sep 2019 10:18:00 +0000 (12:18 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:45:55 +0000 (13:45 +0200)
tests/methods/prepostconditions.vala

index 214c4800a61cd06f5b9f820110d19c7fc1850ba8..0ae57e054edead6f33a7bf6f47176a7be2c468a8 100644 (file)
@@ -5,6 +5,9 @@ class Foo {
        public Foo () requires (required = true) {
        }
 
+       public Foo.post () ensures (ensured = true) {
+       }
+
        public void foo () ensures (ensured = true) {
        }
 
@@ -50,4 +53,7 @@ void main () {
        assert(foo.bar_pre (4711) == 4711);
        assert (foo.faz (42) == 42);
        assert (foo.faz_pre (4711) == 4711);
+
+       var foo2 = new Foo.post ();
+       assert (foo2.ensured);
 }