]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "emit order" tests
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 7 Dec 2018 08:22:20 +0000 (09:22 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 18 Dec 2018 08:06:02 +0000 (09:06 +0100)
tests/Makefile.am
tests/ordering/delegate-class.vala [new file with mode: 0644]
tests/ordering/delegate-enum.vala [new file with mode: 0644]
tests/ordering/delegate-interface.vala [new file with mode: 0644]
tests/ordering/delegate-struct.vala [new file with mode: 0644]

index 9782996bd930d39c18e8c8a64d4722e79b7e0c33..689ce3537e265299cb3ed8ad546bc9091b01ae5b 100644 (file)
@@ -511,6 +511,10 @@ TESTS = \
        resolver/class-base-cycle.test \
        resolver/interface-prerequisite-cycle.test \
        resolver/struct-base-cycle.test \
+       ordering/delegate-class.vala \
+       ordering/delegate-enum.vala \
+       ordering/delegate-interface.vala \
+       ordering/delegate-struct.vala \
        semantic/array-stacked.test \
        semantic/array-incompatible-initializer.test \
        semantic/array-incompatible-initializer2.test \
diff --git a/tests/ordering/delegate-class.vala b/tests/ordering/delegate-class.vala
new file mode 100644 (file)
index 0000000..d72327f
--- /dev/null
@@ -0,0 +1,11 @@
+[CCode (has_target = false)]
+delegate Foo Func (Foo p);
+
+class Foo {
+       public Func foo (Func p) {
+               return p;
+       }
+}
+
+void main () {
+}
diff --git a/tests/ordering/delegate-enum.vala b/tests/ordering/delegate-enum.vala
new file mode 100644 (file)
index 0000000..54c2d8f
--- /dev/null
@@ -0,0 +1,9 @@
+[CCode (has_target = false)]
+delegate Foo Func (Foo p);
+
+enum Foo {
+       BAR;
+}
+
+void main () {
+}
diff --git a/tests/ordering/delegate-interface.vala b/tests/ordering/delegate-interface.vala
new file mode 100644 (file)
index 0000000..f8befa2
--- /dev/null
@@ -0,0 +1,9 @@
+[CCode (has_target = false)]
+delegate Foo Func (Foo p);
+
+interface Foo {
+       public abstract Func foo (Func p);
+}
+
+void main () {
+}
diff --git a/tests/ordering/delegate-struct.vala b/tests/ordering/delegate-struct.vala
new file mode 100644 (file)
index 0000000..3898423
--- /dev/null
@@ -0,0 +1,9 @@
+[CCode (has_target = false)]
+delegate Foo Func (Foo p);
+
+struct Foo {
+       public int i;
+}
+
+void main () {
+}