/[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 7 by dpavlin, Sun Aug 17 22:54:02 2008 UTC revision 15 by dpavlin, Mon Aug 18 17:26:01 2008 UTC
# Line 5  use strict; Line 5  use strict;
5    
6  use blib;  use blib;
7    
8  use Test::More tests => 9;  use Test::More tests => 15;
9  use Test::Exception;  use Test::Exception;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11    
# Line 13  BEGIN { Line 13  BEGIN {
13  use_ok( 'Search::TokyoDystopia' );  use_ok( 'Search::TokyoDystopia' );
14  }  }
15    
16    my $path = 'casket';
17    
18  cmp_ok( $Search::TokyoDystopia::debug, '==', 0, '$debug' );  cmp_ok( $Search::TokyoDystopia::debug, '==', 0, '$debug' );
19    
20  cmp_ok( Search::TokyoDystopia::errmsg(0), 'eq', 'success', 'errmsg' );  cmp_ok( tcidberrmsg(0), 'eq', 'success', 'tcidberrmsg' );
21    
22    ok( my $idb = tcidbnew, 'tcidbnew' );   # FIXME check better
23    
24    ok( ! tcidbdel( $idb ), 'tcidbdel' );
25    
26    ok( $idb = tcidbnew, 'tcidbnew again' );
27    
28    is( tcidbecode( $idb ), 0, 'tcidbecode' );
29    
30    ok( tcidbtune( $idb, 0, 0, 0, IDBTLARGE | IDBTDEFLATE ), 'tcidbtune' );
31    
32    ok( tcidbsetcache( $idb, 0, 0 ), 'tcidbsetcache' );
33    
34    ok( tcidbsetfwmmax( $idb, 0 ), 'tcidbsetfwmmax' );
35    
36  ok( my $db = Search::TokyoDystopia::new, 'new' );       # FIXME check better  ok( tcidbopen( $idb, $path, IDBOWRITER | IDBOCREAT ), "tcidbopen $path" );
37    
38  ok( ! Search::TokyoDystopia::del( $db ), 'del' );  ok( tcidbclose( $idb ), 'tcidbclose' );
39    
40  ok( $db = Search::TokyoDystopia::new, 'new again' );  ok( tcidbopen( $idb, $path, IDBOWRITER | IDBOCREAT ), "tcidbopen $path again" );
41    
42  is( Search::TokyoDystopia::ecode( $db ), 0, 'ecode' );  ok( tcidbput( $idb, 1, 'foobar' ), 'tcidbput' );
43    
44  is( Search::TokyoDystopia::tune( $db, 0, 0, 0, 0  ), 1, 'tune' );  ok( tcidbout( $idb, 1, ), 'tcidbout' );
45    
46  is( Search::TokyoDystopia::setcache( $db, 0, 0 ), 1, 'setcache' );  diag tcidberrmsg( tcidbecode( $idb ) );

Legend:
Removed from v.7  
changed lines
  Added in v.15

  ViewVC Help
Powered by ViewVC 1.1.26