Permalink
Browse files

correct ord_and_chr.t (precedence, calling positionals by name), and …

…fudge for rakudo
  • Loading branch information...
1 parent 8b36d58 commit 8bb65b5958d52b0339436ad180091a5d210f6a86 @moritz moritz committed Jul 4, 2011
Showing with 3 additions and 8 deletions.
  1. +3 −8 S29-conversions/ord_and_chr.t
@@ -121,20 +121,14 @@ my @maps = (
"\o03", 3,
);
-plan 38 + @maps*2;
+plan 38 + @maps;
for @maps -> $char, $code {
my $descr = "\\{$code}{$code >= 32 ?? " == '{$char}'" !! ""}";
is ord($char), $code, "ord() works for $descr";
is chr($code), $char, "chr() works for $descr";
}
-for @maps -> $char, $code {
- my $descr = "\\{$code}{$code >= 32 ?? " == '{$char}'" !! ""}";
- is ord(:string($char)), $code, "ord() works for $descr with named args";
- is chr(:graph($code)), $char, "chr() works for $descr with named args";
-}
-
for 0...31 -> $code {
my $char = chr($code);
is ord($char), $code, "ord(chr($code)) is $code";
@@ -146,7 +140,8 @@ is 65.chr, 'A', "there's a .chr method";
#?rakudo skip 'multi-arg variants of chr not in place yet'
is chr(104, 101, 108, 108, 111), 'hello', 'chr works with a list of ints';
-ok not defined(ord("")), 'ord("") returns an undefined value';
+#?rakudo skip 'ord of empty string'
+ok !defined(ord("")), 'ord("") returns an undefined value';
# RT #65172
#?rakudo skip 'RT 65172'

0 comments on commit 8bb65b5

Please sign in to comment.