- Timestamp:
- 08/06/08 19:09:32 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
perl5/Pugs-Compiler-Rule/t/01-iterator_engine_step.t
r21811 r21812 4 4 use warnings; 5 5 6 use Test::More tests => 53;6 use Test::More tests => 12; 7 7 # use Data::Dumper; 8 8 # $Data::Dumper::Indent = 1; … … 60 60 ] ), 61 61 Pugs::Runtime::Regex::alternation( [ 62 Pugs::Runtime::Regex::constant( ' b' ),62 Pugs::Runtime::Regex::constant( 'x' ), 63 63 Pugs::Runtime::Regex::constant( 'bb' ), 64 64 ] ), 65 65 ] ); 66 66 my $str = 'abbb'; 67 $rule->( $str, undef, {}, $match ); 67 # expected: () (a,bb) () (ab,bb) 68 $rule->( $str, undef, {single_step => 1}, $match ); 68 69 #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 ); 72 73 #print "state 2: ", Dumper($match->state), "\n"; 73 74 is ( $match->str, 'abb', "state #1" ); 74 75 75 $rule->( $str, $match->state, {}, $match ); 76 TODO: { 77 local $TODO = 'concat single-step not implemented'; 78 79 $rule->( $str, $match->state, {single_step => 1}, $match ); 76 80 #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 ); 80 84 #print "state 4: ", Dumper($match->state), "\n"; 81 85 is ( $match->str, 'abbb', "state #3" ); 82 83 } 86 } 87 88 } 89 90 __END__ 84 91 85 92 {
