/[webpac2]/trunk/t/3-normalize-set.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/3-normalize-set.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 484 by dpavlin, Sat May 13 12:37:35 2006 UTC revision 485 by dpavlin, Sun May 14 11:06:42 2006 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 43;  use Test::More tests => 56;
6  use Test::Exception;  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use blib;  use blib;
# Line 171  sub test_s { Line 171  sub test_s {
171                  ),                  ),
172          'eq', 'lookup 1 i lookup 2', 'join lookup regex rec2');          'eq', 'lookup 1 i lookup 2', 'join lookup regex rec2');
173    
174            # check join_with operations
175    
176            sub test_join_with_2 {
177                    my ($a,$b,$e) = @_;
178    
179                    cmp_ok(
180                            join_with(" <1> ",
181                                    rec('201',$a),
182                                    rec('201',$b),
183                            ),
184                    'eq', $e, "join_with $a <1> $b = $e");
185            }
186    
187            test_join_with_2('_','_','');
188            test_join_with_2('x','_','201x');
189            test_join_with_2('_','x','201x');
190            test_join_with_2('x','y','201x <1> 201y');
191    
192            sub test_join_with_3 {
193                    my ($a,$b,$c,$e) = @_;
194    
195                    cmp_ok(
196                            join_with(" <1> ", rec('201',$a),
197                                    join_with(" <2> ", rec('201',$b),
198                                            rec('201',$c),
199                                    )
200                            ),
201                    'eq', $e, "join_with $a <1> $b <2> $c = $e");
202            };
203    
204            test_join_with_3('_','_','_','');
205            test_join_with_3('x','_','_','201x');
206            test_join_with_3('_','x','_','201x');
207            test_join_with_3('_','_','x','201x');
208            test_join_with_3('x','y','_','201x <1> 201y');
209            test_join_with_3('x','_','y','201x <1> 201y');
210            test_join_with_3('_','x','y','201x <2> 201y');
211            test_join_with_3('x','_','y','201x <1> 201y');
212            test_join_with_3('x','y','x','201x <1> 201y <2> 201x');
213    
214            # test lookups
215    
216          set_lookup( $lookup2 );          set_lookup( $lookup2 );
217    
218          is_deeply( \[ lookup( prefix( '00', rec('902') ) ) ], \[ 'lookup' ], 'lookup prefix' );          is_deeply( \[ lookup( prefix( '00', rec('902') ) ) ], \[ 'lookup' ], 'lookup prefix' );

Legend:
Removed from v.484  
changed lines
  Added in v.485

  ViewVC Help
Powered by ViewVC 1.1.26