Changeset 8705 for t/var/caller.t

Show
Ignore:
Timestamp:
01/16/06 18:57:28 (3 years ago)
Author:
audreyt
Message:

* Support for $+var as shorthand for $CALLER::var.
* CALLER now only sees lexical variables in the outer dynamic

scope declared with the "env" scope specifier.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/var/caller.t

    r8080 r8705  
    44use Test; 
    55 
    6 plan 17; 
     6plan 18; 
    77 
    88{ 
     
    7373 
    7474  $_ = 23; 
    75   is bar(), 42, '$_ is implicitly declared "env" (2)'; 
     75  is bar(), 42, '$_ is implicitly declared "env" (2)', :todo<bug>; 
    7676} 
    7777 
     
    120120  env $foo is rw = 42; 
    121121  lives_ok { modify() }, 
    122       'env() vars declared "is rw" are rw when accessed with $CALLER:: (1)'; 
     122      'env() vars declared "is rw" are rw when accessed with $CALLER:: (1)', :todo<bug>; 
    123123  is $foo, 43, 
    124       'env() vars declared "is rw" are rw when accessed with $CALLER:: (2)'; 
     124      'env() vars declared "is rw" are rw when accessed with $CALLER:: (2)', :todo<bug>; 
    125125} 
    126  
    127 =begin underspecced 
    128  
    129 # Is $+foo really short for $CALLER::foo? S02 doesn't make this 100% clear. 
    130126 
    131127{ 
     
    136132} 
    137133 
    138 =end underspecced 
    139  
    140 =cut 
    141  
    142134# Rebinding caller's variables -- legal? 
    143135{ 
     
    146138  env $foo = 42; 
    147139 
    148   lives_ok { rebind_foo() }, 'rebinding $CALLER:: variables works (1)'; 
    149   is $foo, 23,               'rebinding $CALLER:: variables works (2)'; 
     140  lives_ok { rebind_foo() }, 'rebinding $CALLER:: variables works (1)', :todo<bug>; 
     141  is $foo, 23,               'rebinding $CALLER:: variables works (2)', :todo<bug>; 
    150142  $other_var++; 
    151   is $foo, 24,               'rebinding $CALLER:: variables works (3)'; 
     143  is $foo, 24,               'rebinding $CALLER:: variables works (3)', :todo<bug>; 
    152144} 
    153145