]> 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>
Thu, 7 Nov 2019 10:52:20 +0000 (11:52 +0100)
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 180c22e974a8e0df1a48a19efed1612b517e7d22..f7f9b297407636e077071e0cd5ea12b1c3708f4d 100644 (file)
@@ -225,6 +225,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 \
@@ -300,6 +301,7 @@ TESTS = \
        objects/compact-class-destructor.vala \
        objects/compact-class-refcount.vala \
        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 () {
+}