[vala/wip/issue/370: 3/3] tests: Add partial class test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/370: 3/3] tests: Add partial class test
- Date: Tue, 21 Sep 2021 12:32:20 +0000 (UTC)
commit 4c742a1a9115d1234a83d082a9d6e4dbed16a6c2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Sep 21 14:31:22 2021 +0200
tests: Add partial class test
tests/Makefile.am | 1 +
tests/objects/class-partial.vala | 53 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ed1ef5980..85dbc0fba 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -440,6 +440,7 @@ TESTS = \
objects/class-destroysinstance.vala \
objects/class-inner-types.vala \
objects/class-new-no-override.vala \
+ objects/class-partial.vala \
objects/class-vfunc-base-access.vala \
objects/classes.vala \
objects/classes-interfaces.vala \
diff --git a/tests/objects/class-partial.vala b/tests/objects/class-partial.vala
new file mode 100644
index 000000000..f54669f15
--- /dev/null
+++ b/tests/objects/class-partial.vala
@@ -0,0 +1,53 @@
+public partial class Foo {
+ public string p0 { get; set; }
+ public string f0;
+ public void m0 () {
+ }
+ public virtual void v0 () {
+ }
+ public virtual signal void s0 () {
+ }
+}
+
+public partial class Foo {
+ public string p1 { get; set; }
+ public string f1;
+ public void m1 () {
+ }
+ public virtual void v1 () {
+ }
+ public virtual signal void s1 () {
+ }
+}
+
+public partial class Foo {
+ public string p2 { get; set; }
+ public string f2;
+ public void m2 () {
+ }
+ public virtual void v2 () {
+ }
+ public virtual signal void s2 () {
+ }
+}
+
+void main () {
+ var foo = new Foo ();
+ foo.p0 = "p0";
+ foo.f0 = "f0";
+ foo.m0 ();
+ foo.v0 ();
+ foo.s0 ();
+
+ foo.p1= "p1";
+ foo.f1 = "f1";
+ foo.m1 ();
+ foo.v1 ();
+ foo.s1 ();
+
+ foo.p2= "p2";
+ foo.f2 = "f2";
+ foo.m2 ();
+ foo.v2 ();
+ foo.s2 ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]