/[Search-TokyoDystopia]/t/10-tci.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 /t/10-tci.t

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

revision 20 by dpavlin, Mon Aug 18 18:44:47 2008 UTC revision 25 by dpavlin, Mon Aug 18 19:01:00 2008 UTC
# Line 5  use strict; Line 5  use strict;
5    
6  use blib;  use blib;
7    
8  use Test::More tests => 25;  use Test::More tests => 31;
9  use Test::Exception;  use Test::Exception;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11    
# Line 33  ok( tcidbsetcache( $idb, 0, 0 ), 'tcidbs Line 33  ok( tcidbsetcache( $idb, 0, 0 ), 'tcidbs
33    
34  ok( tcidbsetfwmmax( $idb, 0 ), 'tcidbsetfwmmax' );  ok( tcidbsetfwmmax( $idb, 0 ), 'tcidbsetfwmmax' );
35    
36  ok( tcidbopen( $idb, $path, IDBOWRITER | IDBOCREAT ), "tcidbopen $path" );  ok( tcidbopen( $idb, $path, IDBOWRITER | IDBOCREAT | IDBOTRUNC ), "tcidbopen $path" );
37    
38  ok( tcidbclose( $idb ), 'tcidbclose' );  ok( tcidbclose( $idb ), 'tcidbclose' );
39    
# Line 51  is_deeply( tcidbsearch( $idb, 'some', ID Line 51  is_deeply( tcidbsearch( $idb, 'some', ID
51  ok( tcidbput( $idb, 65536, 'some more data' ), 'tcidbput more data' );  ok( tcidbput( $idb, 65536, 'some more data' ), 'tcidbput more data' );
52  is_deeply( tcidbsearch( $idb, 'some', IDBSSUBSTR ), [ 42, 65536 ], 'tcidbsearch' );  is_deeply( tcidbsearch( $idb, 'some', IDBSSUBSTR ), [ 42, 65536 ], 'tcidbsearch' );
53    
54    is_deeply( tcidbsearch2( $idb, 'some' ), [ 42, 65536 ], 'tcidbsearch2' );
55    
56  ok( tcidbiterinit( $idb ), 'tcidbiterinit' );  ok( tcidbiterinit( $idb ), 'tcidbiterinit' );
57    
58  my @ids;  my @ids;
# Line 63  while ( my $id = tcidbiternext( $idb ) ) Line 65  while ( my $id = tcidbiternext( $idb ) )
65  # order is not defined, so we need to sort it  # order is not defined, so we need to sort it
66  is_deeply( [ sort @ids ], [ 42, 65536 ], 'all records' );  is_deeply( [ sort @ids ], [ 42, 65536 ], 'all records' );
67    
68    ok( tcidbsync( $idb ), 'tcidbsync' );
69    
70    ok( tcidboptimize( $idb ), 'tcidboptimize' );
71    
72    ok( tcidbvanish( $idb ), 'tcidbvanish' );
73    
74    my $copy_path = $path . '-copy';
75    
76    ok( tcidbcopy( $idb, $copy_path ), "tcidbcopy $copy_path" );
77    ok( -e $copy_path, 'copy exists' );
78    
79  diag tcidberrmsg( tcidbecode( $idb ) );  diag tcidberrmsg( tcidbecode( $idb ) );

Legend:
Removed from v.20  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26