--- t/10-xs.t 2008/08/18 18:53:39 22 +++ t/10-tci.t 2008/09/21 14:24:22 36 @@ -5,7 +5,7 @@ use blib; -use Test::More tests => 27; +use Test::More tests => 36; use Test::Exception; use Data::Dump qw/dump/; @@ -13,7 +13,7 @@ use_ok( 'Search::TokyoDystopia' ); } -my $path = 'casket'; +my $path = 'casket-idb'; cmp_ok( $Search::TokyoDystopia::debug, '==', 0, '$debug' ); @@ -67,4 +67,23 @@ ok( tcidbsync( $idb ), 'tcidbsync' ); +ok( tcidboptimize( $idb ), 'tcidboptimize' ); + +my $copy_path = $path . '-copy'; + +ok( tcidbcopy( $idb, $copy_path ), "tcidbcopy $copy_path" ); +ok( -e $copy_path, 'copy exists' ); + +is( tcidbpath( $idb ), $path, 'tcidbpath' ); + +is( tcidbrnum( $idb ), 2, 'tcidbrnum' ); + +ok( my $file_size = tcidbfsiz( $idb ), 'tcidbfsiz' ); + +ok( tcidbvanish( $idb ), 'tcidbvanish' ); + +is( tcidbrnum( $idb ), 0, 'tcidbrnum' ); + +cmp_ok( tcidbfsiz( $idb ), '<', $file_size, 'tcidbfsiz' ); + diag tcidberrmsg( tcidbecode( $idb ) );