[vala/0.46] tests: Add "wrongly named constructor" tests



commit 2ad3f03928c82e1ab4480e35eeed6d9e1dc3844f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Oct 15 13:59:19 2019 +0200

    tests: Add "wrongly named constructor" tests

 tests/Makefile.am                         |  2 ++
 tests/objects/constructor-wrong-name.test |  9 +++++++++
 tests/structs/constructor-wrong-name.test | 11 +++++++++++
 3 files changed, 22 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 65ca01acd..27988f053 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -227,6 +227,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 \
@@ -305,6 +306,7 @@ TESTS = \
        objects/compact-class-refcount.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
index 000000000..5bd968de1
--- /dev/null
+++ b/tests/objects/constructor-wrong-name.test
@@ -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
index 000000000..95aa1c4ad
--- /dev/null
+++ b/tests/structs/constructor-wrong-name.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+struct Foo {
+       public int i;
+
+       public Bar () {
+       }
+}
+
+void main () {
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]