--- t/10-xs.t 2008/08/17 22:58:23 9 +++ t/10-xs.t 2008/08/18 13:17:52 13 @@ -5,7 +5,7 @@ use blib; -use Test::More tests => 10; +use Test::More tests => 12; use Test::Exception; use Data::Dump qw/dump/; @@ -13,21 +13,26 @@ use_ok( 'Search::TokyoDystopia' ); } +my $path = 'casket'; + cmp_ok( $Search::TokyoDystopia::debug, '==', 0, '$debug' ); -cmp_ok( Search::TokyoDystopia::errmsg(0), 'eq', 'success', 'errmsg' ); +cmp_ok( tcidberrmsg(0), 'eq', 'success', 'tcidberrmsg' ); + +ok( my $idb = tcidbnew, 'tcidbnew' ); # FIXME check better -ok( my $db = Search::TokyoDystopia::new, 'new' ); # FIXME check better +ok( ! tcidbdel( $idb ), 'tcidbdel' ); -ok( ! Search::TokyoDystopia::del( $db ), 'del' ); +ok( $idb = tcidbnew, 'tcidbnew again' ); -ok( $db = Search::TokyoDystopia::new, 'new again' ); +is( tcidbecode( $idb ), 0, 'tcidbecode' ); -is( Search::TokyoDystopia::ecode( $db ), 0, 'ecode' ); +ok( tcidbtune( $idb, 0, 0, 0, IDBTLARGE | IDBTDEFLATE ), 'tcidbtune' ); -is( Search::TokyoDystopia::tune( $db, 0, 0, 0, 0 ), 1, 'tune' ); +ok( tcidbsetcache( $idb, 0, 0 ), 'tcidbsetcache' ); -is( Search::TokyoDystopia::setcache( $db, 0, 0 ), 1, 'setcache' ); +ok( tcidbsetfwmmax( $idb, 0 ), 'tcidbsetfwmmax' ); -is( Search::TokyoDystopia::setfwmmax( $db, 0 ), 1, 'setfwmmax' ); +ok( tcidbopen( $idb, $path, IDBOWRITER | IDBOCREAT ), "tcidbopen $path" ); +ok( tcidbclose( $idb ), 'tcidbclose' );