3 |
use strict; |
use strict; |
4 |
|
|
5 |
use Test::More; |
use Test::More; |
6 |
use File::Path qw(rmtree); |
#use blib; |
|
use blib; |
|
7 |
|
|
8 |
BEGIN { use_ok('WAIT::Database'); } |
BEGIN { use_ok('WAIT::Database'); } |
9 |
END { system 'rm -rf test' if -d 'test'; } |
END { system 'rm -rf test' if -d 'test'; } |
10 |
|
|
11 |
plan tests => 31; |
plan tests => 17; |
12 |
|
|
13 |
ok(my $db = WAIT::Database->create(name => 'test'), "create"); |
ok(my $db = WAIT::Database->create(name => 'test'), "create"); |
14 |
|
|
15 |
ok(my $tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table"); |
ok(my $tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table"); |
16 |
|
|
|
use Data::Dumper; |
|
|
print Dumper($tb); |
|
|
|
|
17 |
ok($db->drop_table(name => 'sample'), "drop_table"); |
ok($db->drop_table(name => 'sample'), "drop_table"); |
18 |
|
|
19 |
ok (!$tb->drop, "tb->drop"); |
ok($tb->drop, "tb->drop"); |
20 |
|
|
21 |
ok ($tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table"); |
ok($tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table"); |
22 |
|
|
23 |
ok($tb->open, "tb->open"); |
ok($tb->open, "tb->open"); |
24 |
|
|