Changeset 21158

Show
Ignore:
Timestamp:
07/02/08 04:01:30 (3 months ago)
Author:
Auzon
Message:

[gsoc_spectest] fudged reverse.t for Rakudo

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S29-list/reverse.t

    r21157 r21158  
    1313 
    1414# As a function : 
     15#?rakudo skip 'reverse as a function does not work' 
    1516is( reverse('Pugs'), 'sguP', "as a function"); 
    1617 
     
    2627 
    2728# Multiple iterations (don't work in 6.2.12) : 
     29#?rakudo skip 'parsefail' 
    2830is( 'Hello World !'.reverse.reverse, 'Hello World !',  
    2931        "two reverse in a row." ); 
     
    4749is(@a, @e, "list was reversed"); 
    4850 
    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"); 
    5155 
    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'); 
    5660 
    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'); 
    6266 
    63 is(@a[1], "foo", 'the list was reversed properly'); 
     67    is(@a[1], "foo", 'the list was reversed properly'); 
     68} 
    6469 
     70#?rakudo skip 'reverse as a function, parsefails' 
    6571{ 
    6672    my @cxt_log; 
     
    127133    my $a = "foo"; 
    128134    my @b = $a.reverse; 
     135    #?rakudo skip '.isa does not work correctly' 
    129136    isa_ok(@b, 'Array');     
    130137    my $b = $a.reverse; 
     
    142149    my @b = "foo".reverse; 
    143150    isa_ok($a, 'Str'); 
     151    #?rakudo skip '.isa does not work correctly' 
    144152    isa_ok(@b, 'Array'); 
    145153    is($a, "oof", 'string literal reversal works in scalar context'); 
     
    156164=end pod 
    157165 
     166#?rakudo skip 'reverse for hash not implemented' 
    158167{ 
    159168    my %hash = <a b c d>; 
     
    162171} 
    163172 
     173#?rakudo skip 'reverse for hash not implemented (unspecced behavior here)' 
    164174{ 
    165175    my %hash = reverse {0 => 'a', 1 => 'a'};