# $Id: 02-search-get.t,v 1.3 2000/12/18 04:32:43 knok Exp $
#

use strict;
use Test;

BEGIN { plan tests => 3 }

use Search::Saryer;
my $file = 't/01-new-destroy.t';
my $searchstr = 'Sary';
my $exct = 3;

print STDERR "\nCreate suffix array\n";
system("mksary $file");
print STDERR "Create Saryer object.\n";
my $x = Search::Saryer::new('filename' => $file);
ok(defined $x);

$x->search($searchstr);
ok(1);
$x->sort_occurrences();

my $count = 0;
while (1) {
      my $ret = $x->get_next_line();
      last unless defined $ret;
      print STDERR "get_next_line: $ret";
      $count ++;
}
ok($count == $exct);
