]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "instance access to implicit to_string() method of enum" test
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 18 Oct 2021 07:19:07 +0000 (09:19 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 19 Oct 2021 07:49:14 +0000 (09:49 +0200)
tests/Makefile.am
tests/enums/bug614424.vala [new file with mode: 0644]

index 07f60757295b9fed58471d834d7382967edb3f9b..759bb8cfbb88d96f893dcf03ab4430cef9180ebe 100644 (file)
@@ -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 (file)
index 0000000..7312eed
--- /dev/null
@@ -0,0 +1,11 @@
+enum Foo {
+       BAR;
+
+       public string bar () {
+               return to_string ();
+       }
+}
+
+void main () {
+       assert (Foo.BAR.bar () == "FOO_BAR");
+}