From f3f466b1fc169c544451187f7741dcfe5a4e0cf8 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 15 Oct 2019 13:59:19 +0200 Subject: [PATCH] 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(+) create mode 100644 tests/objects/constructor-wrong-name.test create mode 100644 tests/structs/constructor-wrong-name.test diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b56bb89d..4fe6f9b3a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 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 () { +} -- 2.47.2