Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[t/spec] differentiate reverse from flip and invert

git-svn-id: http://svn.pugscode.org/pugs@26184 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit ade1f3b9d4f2982d58b31daa1e4dbf04e4de13c9 1 parent e9f933d
lwall authored
View
2  S02-literals/misc-interpolation.t
@@ -57,7 +57,7 @@ is("&func_w_args("foo","bar"))", '[foo][bar])', '"&func_w_args(...)" should inte
is("$world.chars()", '5', 'method calls with parens should interpolate');
is("$world.chars", 'World.chars', 'method calls without parens should not interpolate');
#?rakudo 2 todo 'method interpolation'
-is("$world.reverse.chars()", '5', 'cascade of argumentless methods, last ending in paren');
+is("$world.flip.chars()", '5', 'cascade of argumentless methods, last ending in paren');
is("$world.substr(0,1)", 'W', 'method calls with parens and args should interpolate');
# Single quotes
View
8 S32-hash/reverse.t
@@ -5,16 +5,16 @@ plan 5;
{
my %h = a => 'b', c => 'd';
- isa_ok %h.reverse, List, 'Hash.reverse returns a List';
- is_deeply %h.reverse, (b => 'a', d => 'c'), 'simple Hash.reverse works';
+ isa_ok %h.invert, List, 'Hash.invert returns a List';
+ is_deeply %h.invert, (b => 'a', d => 'c'), 'simple Hash.invert works';
is_deeply %h, { a => 'b', c => 'd' }, 'original remains unchanged';
}
{
# with lists
my %h = a => <b c>, d => 'e';
- is_deeply %h.reverse.sort, (b => 'a', c => 'a', e => 'd'),
- 'Hash.reverse flattens list values';
+ is_deeply %h.invert.sort, (b => 'a', c => 'a', e => 'd'),
+ 'Hash.invert flattens list values';
is_deeply %h, {a => <b c>, d => 'e'}, 'original remains unchanged';
}
View
2  S32-str/flip.t
@@ -14,7 +14,7 @@ is( 'Hello World !'.flip, '! dlroW olleH', "literal" );
my Str $a = 'Hello World !';
is( $a.flip, '! dlroW olleH', "with a Str variable" );
is( $a, 'Hello World !', "flip should not be in-place" );
-is( $a .= flip, '! dlroW olleH', "after a .=reverse" );
+is( $a .= flip, '! dlroW olleH', "after a .=flip" );
# Multiple iterations (don't work in 6.2.12) :
is( 'Hello World !'.flip.flip, 'Hello World !',
View
8 S32-str/pack.t
@@ -735,7 +735,7 @@ sub byteorder
is($nat, $ByteOrder eq 'big' ? $be : $le);
}
- is($be, reverse($le));
+ is($be, flip($le));
my @x = eval { unpack "$format$format>$format<", $nat.$be.$le };
print "# [$value][", join('][', @x), "][$@]\n";
@@ -820,7 +820,7 @@ SKIP: {
}
is($be, $ref[$i]);
- is($be, reverse($le));
+ is($be, flip($le));
}
}
}
@@ -939,10 +939,10 @@ is(ord(pack('U', 300)), 300);
# does unpack U deref Unicode?
is((unpack('U', chr(300)))[0], 300);
-# is unpack U the reverse of pack U for Unicode string?
+# is unpack U the flip of pack U for Unicode string?
is("@{[unpack('U*', pack('U*', 100, 200, 300))]}", "100 200 300");
-# is unpack U the reverse of pack U for byte string?
+# is unpack U the flip of pack U for byte string?
is("@{[unpack('U*', pack('U*', 100, 200))]}", "100 200");
Please sign in to comment.
Something went wrong with that request. Please try again.