/[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 485 by dpavlin, Sun May 14 11:06:42 2006 UTC revision 490 by dpavlin, Sun May 14 12:35:20 2006 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 56;  use Test::More tests => 64;
6  use Test::Exception;  use Test::Exception;
7  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
8  use blib;  use blib;
# Line 291  sub test_s { Line 291  sub test_s {
291    
292          ok($ds = get_ds(), "get_ds");          ok($ds = get_ds(), "get_ds");
293          diag "ds = ", Dumper($ds) if ($debug);          diag "ds = ", Dumper($ds) if ($debug);
294    
295            my $rec = {
296                    '200' => [{
297                            'a' => '200a',
298                            'b' => '200b',
299                    }],
300            };
301            my $rules = qq{ search('mixed', rec('200') ) };
302            
303            clean_ds();
304            set_rec( $rec );
305            test_s( $rules );
306            ok($ds = get_ds(), "get_ds");
307            is_deeply( $ds, {
308                    'mixed' => {
309                            'search' => [ '200a', '200b' ],
310                            'tag' => 'mixed'
311                    }
312            }, 'correct get_ds');
313    
314            ok(my $ds2 = WebPAC::Normalize::Set::data_structure(
315                    row => $rec,
316                    rules => $rules,
317            ), 'data_structure');
318            is_deeply( $ds, $ds2, 'data_structure(s) same');
319    
320            # wird and non-valid structure which is supported anyway
321            clean_ds();
322            set_rec({
323                    '200' => [{
324                            'a' => '200a',
325                    },
326                            '200-solo'
327                    ]
328            });
329            test_s(qq{ search('mixed', rec('200') ) });
330            ok($ds = get_ds(), "get_ds");
331            is_deeply( $ds, {
332                    'mixed' => {
333                            'search' => [ '200a', '200-solo' ],
334                            'tag' => 'mixed'
335                    }
336            }, 'correct get_ds');
337    
338  }  }
339    

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

  ViewVC Help
Powered by ViewVC 1.1.26