Changeset 22931 for t

Show
Ignore:
Timestamp:
11/08/08 21:17:02 (2 months ago)
Author:
masak
Message:

[S04-statements/for-scope.t] added tests against [perl #60404]

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S04-statements/for-scope.t

    r22140 r22931  
    33use Test; 
    44 
    5 plan 12; 
     5plan 15; 
    66 
    77# Implicit $_ 
     
    4343    is(@inside.join(""), "123", "lexical array properly initialized, round $_, two explicit \$_s"); 
    4444} 
     45 
     46sub respect(*@a) { 
     47    my @b = (); 
     48    push @b for @a; 
     49    return @b.elems; 
     50} 
     51 
     52is respect(1,2,3), 3, 'a for loop inside a sub loops over each of the elements'; 
     53is respect([1,2,3]), 3, '...even if they are sent as an array ref'; # is this right? 
     54is respect( my @a = 1, 2, 3 ), 3, '...and when the array is declared in the argument list';