]> 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>
Fri, 7 Dec 2018 15:35:26 +0000 (16:35 +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 6f276d6594373df71b2b835b8956bc36ae43cc49..a4b93c1c56c5cbec2d0e2975a2f8b16cc725e020 100644 (file)
@@ -521,6 +521,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 () {
+}