Changeset 21812 for perl5

Show
Ignore:
Timestamp:
08/06/08 19:09:32 (4 months ago)
Author:
fglock
Message:

[PCR] tests for parallel-concat

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • perl5/Pugs-Compiler-Rule/t/01-iterator_engine_step.t

    r21811 r21812  
    44use warnings; 
    55 
    6 use Test::More tests => 53; 
     6use Test::More tests => 12; 
    77# use Data::Dumper; 
    88# $Data::Dumper::Indent = 1; 
     
    6060      ] ), 
    6161      Pugs::Runtime::Regex::alternation( [ 
    62         Pugs::Runtime::Regex::constant( 'b' ),  
     62        Pugs::Runtime::Regex::constant( 'x' ),  
    6363        Pugs::Runtime::Regex::constant( 'bb' ),  
    6464      ] ), 
    6565    ] ); 
    6666  my $str = 'abbb'; 
    67   $rule->( $str, undef, {}, $match ); 
     67  # expected: () (a,bb) () (ab,bb) 
     68  $rule->( $str, undef, {single_step => 1}, $match ); 
    6869  #print "state 1: ", Dumper($match->state), "\n"; 
    69   is ( $match->str, 'ab', "/[a|ab][b|bb]/ continuation state #0" ); 
    70  
    71   $rule->( $str, $match->state, {}, $match ); 
     70  is ( $match->str, '', "/[a|ab][b|bb]/ continuation state #0" ); 
     71 
     72  $rule->( $str, $match->state, {single_step => 1}, $match ); 
    7273  #print "state 2: ", Dumper($match->state), "\n"; 
    7374  is ( $match->str, 'abb', "state #1" ); 
    7475 
    75   $rule->( $str, $match->state, {}, $match ); 
     76TODO: { 
     77  local $TODO = 'concat single-step not implemented'; 
     78 
     79  $rule->( $str, $match->state, {single_step => 1}, $match ); 
    7680  #print "state 3: ", Dumper($match->state), "\n"; 
    77   is ( $match->str, 'abb', "state #2" ); 
    78  
    79   $rule->( $str, $match->state, {}, $match ); 
     81  is ( $match->str, '', "state #2" ); 
     82 
     83  $rule->( $str, $match->state, {single_step => 1}, $match ); 
    8084  #print "state 4: ", Dumper($match->state), "\n"; 
    8185  is ( $match->str, 'abbb', "state #3" ); 
    82  
    83 } 
     86} 
     87 
     88} 
     89 
     90__END__ 
    8491 
    8592{