]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "wrongly named constructor" tests
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 15 Oct 2019 11:59:19 +0000 (13:59 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 15 Oct 2019 15:45:52 +0000 (17:45 +0200)
tests/Makefile.am
tests/objects/constructor-wrong-name.test [new file with mode: 0644]
tests/structs/constructor-wrong-name.test [new file with mode: 0644]

index 5b56bb89d05bf546b7a9df64e041f159750a0cf3..4fe6f9b3a1eab38b124c563953222cbc1255b587 100644 (file)
@@ -228,6 +228,7 @@ TESTS = \
        structs/struct-static-field-initializer.test \
        structs/struct-static-property-initializer.test \
        structs/structs.vala \
+       structs/constructor-wrong-name.test \
        structs/default-gtype.vala \
        structs/gmutex.vala \
        structs/gvalue.vala \
@@ -308,6 +309,7 @@ TESTS = \
        objects/compact-class-custom-ref.vala \
        objects/constructor-abstract-public.test \
        objects/constructor-variadic.test \
+       objects/constructor-wrong-name.test \
        objects/constructors.vala \
        objects/destructors.vala \
        objects/duplicating-instance-invalid.test \
diff --git a/tests/objects/constructor-wrong-name.test b/tests/objects/constructor-wrong-name.test
new file mode 100644 (file)
index 0000000..5bd968d
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+class Foo {
+       public Bar () {
+       }
+}
+
+void main () {
+}
diff --git a/tests/structs/constructor-wrong-name.test b/tests/structs/constructor-wrong-name.test
new file mode 100644 (file)
index 0000000..95aa1c4
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+struct Foo {
+       public int i;
+
+       public Bar () {
+       }
+}
+
+void main () {
+}