[vala/staging] tests: Add "instance access to implicit to_string() method of enum" test



commit 9e336f272c62c1603945839c810c39a74c2e2a8b
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Oct 18 09:19:07 2021 +0200

    tests: Add "instance access to implicit to_string() method of enum" test

 tests/Makefile.am          |  1 +
 tests/enums/bug614424.vala | 11 +++++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 904ae9739..3ea602a23 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -335,6 +335,7 @@ TESTS = \
        enums/in-invalid.test \
        enums/no_gtype_to_string.vala \
        enums/switch.vala \
+       enums/bug614424.vala \
        enums/bug666035.vala \
        enums/bug666035-1.test \
        enums/bug666035-2.test \
diff --git a/tests/enums/bug614424.vala b/tests/enums/bug614424.vala
new file mode 100644
index 000000000..7312eed0b
--- /dev/null
+++ b/tests/enums/bug614424.vala
@@ -0,0 +1,11 @@
+enum Foo {
+       BAR;
+
+       public string bar () {
+               return to_string ();
+       }
+}
+
+void main () {
+       assert (Foo.BAR.bar () == "FOO_BAR");
+}


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