Changeset 21158
- Timestamp:
- 07/02/08 04:01:30 (3 months ago)
- Files:
-
- 1 modified
-
t/spec/S29-list/reverse.t (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S29-list/reverse.t
r21157 r21158 13 13 14 14 # As a function : 15 #?rakudo skip 'reverse as a function does not work' 15 16 is( reverse('Pugs'), 'sguP', "as a function"); 16 17 … … 26 27 27 28 # Multiple iterations (don't work in 6.2.12) : 29 #?rakudo skip 'parsefail' 28 30 is( 'Hello World !'.reverse.reverse, 'Hello World !', 29 31 "two reverse in a row." ); … … 47 49 is(@a, @e, "list was reversed"); 48 50 49 my $a = reverse("foo"); 50 is($a, "oof", "string was reversed"); 51 #?rakudo skip 'reverse as a function' 52 { 53 my $a = reverse("foo"); 54 is($a, "oof", "string was reversed"); 51 55 52 @a = item(reverse("foo"));53 is(@a[0], "oof", 'the string was reversed');54 @a = list(reverse("foo"));55 is(@a[0], "oof", 'the string was reversed even under list context');56 @a = item(reverse("foo")); 57 is(@a[0], "oof", 'the string was reversed'); 58 @a = list(reverse("foo")); 59 is(@a[0], "oof", 'the string was reversed even under list context'); 56 60 57 @a = reverse(~("foo", "bar"));58 is(@a[0], "rab oof", 'the stringified array was reversed (stringwise)');59 @a = list reverse "foo", "bar";60 is(+@a, 2, 'the reversed list has two elements');61 is(@a[0], "bar", 'the list was reversed properly');61 @a = reverse(~("foo", "bar")); 62 is(@a[0], "rab oof", 'the stringified array was reversed (stringwise)'); 63 @a = list reverse "foo", "bar"; 64 is(+@a, 2, 'the reversed list has two elements'); 65 is(@a[0], "bar", 'the list was reversed properly'); 62 66 63 is(@a[1], "foo", 'the list was reversed properly'); 67 is(@a[1], "foo", 'the list was reversed properly'); 68 } 64 69 70 #?rakudo skip 'reverse as a function, parsefails' 65 71 { 66 72 my @cxt_log; … … 127 133 my $a = "foo"; 128 134 my @b = $a.reverse; 135 #?rakudo skip '.isa does not work correctly' 129 136 isa_ok(@b, 'Array'); 130 137 my $b = $a.reverse; … … 142 149 my @b = "foo".reverse; 143 150 isa_ok($a, 'Str'); 151 #?rakudo skip '.isa does not work correctly' 144 152 isa_ok(@b, 'Array'); 145 153 is($a, "oof", 'string literal reversal works in scalar context'); … … 156 164 =end pod 157 165 166 #?rakudo skip 'reverse for hash not implemented' 158 167 { 159 168 my %hash = <a b c d>; … … 162 171 } 163 172 173 #?rakudo skip 'reverse for hash not implemented (unspecced behavior here)' 164 174 { 165 175 my %hash = reverse {0 => 'a', 1 => 'a'};
