2 # Before `make install' is performed this script should be runnable with
3 # `make test'. After `make install' it should work as `perl test.pl'
5 #########################
8 BEGIN { plan tests => 4 };
9 use Search::Xapian qw(:standard);
11 ok(1); # If we made it this far, we're ok.
13 #########################
15 my $db_dir = 'testdb';
17 # Delete contents of database dir, if it exists.
18 if (opendir( DB_DIR, $db_dir )) {
19 while( defined( my $file = readdir( DB_DIR ) ) ) {
20 next if $file =~ /^\.+$/;
21 unlink( "$db_dir/$file" ) or die "Could not delete '$db_dir/$file': $!";
26 is( $Search::Xapian::DB_NAMES[Search::Xapian::DB_CREATE], "DB_CREATE" );
29 ok( $database = Search::Xapian::WritableDatabase->new( $db_dir, Search::Xapian::DB_CREATE ) );
30 ok( $database = Search::Xapian::WritableDatabase->new() );