1use strict; 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' 4 5######################### 6 7use Test::More; 8BEGIN { plan tests => 4 }; 9use Search::Xapian qw(:standard); 10 11ok(1); # If we made it this far, we're ok. 12 13######################### 14 15my $db_dir = 'testdb'; 16 17# Delete contents of database dir, if it exists. 18if (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': $!"; 22 } 23 closedir( DB_DIR ); 24} 25 26is( $Search::Xapian::DB_NAMES[Search::Xapian::DB_CREATE], "DB_CREATE" ); 27 28my $database; 29ok( $database = Search::Xapian::WritableDatabase->new( $db_dir, Search::Xapian::DB_CREATE ) ); 30ok( $database = Search::Xapian::WritableDatabase->new() ); 31 321; 33