Changeset 22037

Show
Ignore:
Timestamp:
08/26/08 18:44:17 (3 months ago)
Author:
moritz
Message:

[t/spec] more tests for hash interpolation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S02-literals/hash-interpolation.t

    r22011 r22037  
    33use Test; 
    44 
    5 plan 7; 
     5plan 10; 
    66 
    77#?rakudo todo 'Hash interpolation with %hash<literal>' 
     
    2727  is "%hash", '%hash', 'no interpolation'; 
    2828} 
     29 
     30#?rakudo skip 'Hash interpolation' 
     31{ 
     32    # "%hash{a}" actually calls a(). Test that. 
     33    my %hash = (a => 1, b => 2); 
     34    sub do_a { 
     35        'b'; 
     36    } 
     37    is "%hash{do_a}", "2",  '%hash{do_a} calls do_a()'; 
     38 
     39    is "%hash{'b'}",  "b",  'can quote hash indexes in interpolations 1'; 
     40    is "%hash{"b"}",  "b",  'can quote hash indexes in interpolations 2'; 
     41}