--- trunk/t/01api.t 2004/12/17 18:32:34 7 +++ trunk/t/01api.t 2004/12/19 03:06:01 8 @@ -2,7 +2,7 @@ use strict; -use Test::More tests => 75; +use Test::More tests => 93; use Test::Exception; use File::Temp qw/ :mktemp /; use blib; @@ -19,17 +19,17 @@ my %param; -throws_ok { SWISH::Split->open(%param) } qr/slice_name/, "slice_name"; +throws_ok { SWISH::Split->open_index(%param) } qr/slice_name/, "slice_name"; sub slice_hash { return $_[0]; }; $param{'slice_name'} = \&slice_hash; -throws_ok { SWISH::Split->open(%param) } qr/slices/, "need slices"; +throws_ok { SWISH::Split->open_index(%param) } qr/slices/, "need slices"; $param{'slices'} = 3; -throws_ok { SWISH::Split->open(%param) } qr/index/, "need index"; +throws_ok { SWISH::Split->open_index(%param) } qr/index/, "need index"; ok($param{'index'} = mktemp("/tmp/swishXXXXX"), "index name"); @@ -38,7 +38,7 @@ ok(open(F, "> $param{'index'}"), "touch"); close(F); -throws_ok { SWISH::Split->open(%param) } qr/dir/, "need dir"; +throws_ok { SWISH::Split->open_index(%param) } qr/dir/, "need dir"; ok(unlink($param{'index'}), "rm"); @@ -48,9 +48,11 @@ PropertyNames foo }; -ok(my $i=SWISH::Split->open(%param), "open"); +$param{'debug'} = 1 if (@ARGV); -cmp_ok(my $s = $i->in_slice("swishpath"), '==', 1, "open"); +ok(my $i=SWISH::Split->open_index(%param), "open_index"); + +cmp_ok(my $s = $i->in_slice("swishpath"), '==', 1, "open_index"); ok(my $config = $i->make_config($s), "make_config"); diag "swish config: $config"; @@ -138,7 +140,7 @@ cmp_ok($i->done, '==', 3, "finish"); foreach (1..$param{'slices'}) { - swish_search( $param{'index'}."/$_", "foo=(bar*)", $slice_files{$_}, "testpath", length($xml)+4, "foo", "bar"); + swish_search( $param{'index'}."/$_", "foo=(bar*)", $slice_files{$_}, "testpath", undef, "foo", "bar"); } #diag "$out";