New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot do .keys on enum type stash in Rakudo #1418
Comments
From @masak<masak> TimToady: how do I get all the names the elements of an enum, in order? <masak> rakudo: enum SomeEnum <a b c>; say SomeEnum::.keys |
From radu_cs85@yahoo.comAdded test for this in t/spec/S02-builtin_data_types/enum.t . |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/enum.t commit ec3fecca07d477e483f061520a4765587652383d [t/spec] Added test for RT70894: Cannot do .keys on enum type stash in Rakudo. Inline Patchdiff --git a/t/spec/S02-builtin_data_types/enum.t b/t/spec/S02-builtin_data_types/enum.t
index 6c573b2..0eddf9f 100644
--- a/t/spec/S02-builtin_data_types/enum.t
+++ b/t/spec/S02-builtin_data_types/enum.t
@@ -83,7 +83,8 @@ is %hash.values.sort, <A B C D E>, '...and the right values are assigned';
%hash = ();
-lives_ok { %hash = enum <<:Alpha<A> Bravo Charlie Delta Echo>>; }, 'specifying a string up front works (Texas quotes)', :todo<feature>;
+#?rakudo todo 'feature'
+lives_ok { %hash = enum <<:Alpha<A> Bravo Charlie Delta Echo>>; }, 'specifying a string up front works (Texas quotes)';
#?pugs todo 'feature'
is %hash.keys.sort, <Alpha Bravo Charlie Delta Echo>, '...and the right keys are assigned';
@@ -133,6 +134,15 @@ is %hash.values, (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'), '
dies_ok { RT66648.c }, 'die attempting to access enum item as method';
}
+# RT #70894
+
+{
+ enum SomeEnum <a b c>;
+ #?rakudo skip "RT #70894"
+ lives_ok {SomeEnum::.keys}, 'keys on enum stash works';
+
+}
+
done_testing;
# vim: ft=perl6 |
From @bbkrNOM: does not die, however output looks wrong bbkr:nom bbkr$ ./perl6 -e 'enum SomeEnum <a b c>; say SomeEnum::.keys' |
From @moritzOn Sun Sep 11 13:33:55 2011, bbkr wrote:
The output is right, in fact. The spec has changed, and the enum keys can be found with I'll unfudge the test in t/spec/S02-types/enum.t and consider this |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#70894 (status was 'resolved')
Searchable as RT70894$
The text was updated successfully, but these errors were encountered: