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



commit a97b83296e7d73933417a1724cb4b734cf55dd4b
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 07f607572..759bb8cfb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -325,6 +325,7 @@ TESTS = \
        enums/in-inference.vala \
        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]