]> 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>
Mon, 18 Oct 2021 07:21:40 +0000 (09:21 +0200)
tests/Makefile.am
tests/enums/bug614424.vala [new file with mode: 0644]

index 904ae9739dff0e709ef3e75b002e410fd8789344..3ea602a23f5b1d9801a60c35280eb8fdb7c4e7f2 100644 (file)
@@ -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 (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");
+}