summaryrefslogtreecommitdiff
path: root/tests/objects/property-construct-only.vala
blob: 70098031501d5c7ce2ea4b2489eb0043141aea9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Foo : GLib.Object {
	public string manam { get; construct; }

	construct {
		manam = "foo";
	}
}

class Bar : Foo {
	construct {
		manam = "bar";
	}
}

class Faz : GLib.Object {
	public string manam { get; construct; }

	public Faz () {
		Object (manam : "faz");
	}
}

class Baz : Faz {
	public Baz () {
		Object (manam : "baz");
	}
}

void main () {
	{
		var foo = new Foo ();
		assert (foo.manam == "foo");
	}
	{
		var bar = new Bar ();
		assert (bar.manam == "bar");
	}
	{
		var faz = new Faz ();
		assert (faz.manam == "faz");
	}
	{
		var baz = new Baz ();
		assert (baz.manam == "baz");
	}
}