[vala/staging] tests: Extend "this chainup in compact class" test



commit b5f4bf0d073ff0b35f564873713df96526464d71
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 8 09:22:13 2021 +0200

    tests: Extend "this chainup in compact class" test

 tests/chainup/class-compact-this.vala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/tests/chainup/class-compact-this.vala b/tests/chainup/class-compact-this.vala
index aed1ab3fe..3ace7a7eb 100644
--- a/tests/chainup/class-compact-this.vala
+++ b/tests/chainup/class-compact-this.vala
@@ -1,15 +1,18 @@
 [Compact]
 class Foo {
+       public string s = "foo";
        public int i = 42;
-       public int j = 23;
+       public int j;
 
        public Foo () {
+               assert (s == "foo");
                assert (i == 42);
                j = 23;
        }
 
        public Foo.bar () {
                this ();
+               assert (s == "foo");
                assert (i == 42);
                assert (j == 23);
        }
@@ -18,11 +21,13 @@ class Foo {
 void main () {
        {
                var foo = new Foo ();
+               assert (foo.s == "foo");
                assert (foo.i == 42);
                assert (foo.j == 23);
        }
        {
                var foo = new Foo.bar ();
+               assert (foo.s == "foo");
                assert (foo.i == 42);
                assert (foo.j == 23);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]