/[wait]/trunk/t/table.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/table.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (show annotations)
Tue Jul 13 21:27:27 2004 UTC (19 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 988 byte(s)
enought for today, still not passing all tests

1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use Test::More;
6 use File::Path qw(rmtree);
7 use blib;
8
9 BEGIN { use_ok('WAIT::Database'); }
10 END { system 'rm -rf test' if -d 'test'; }
11
12 plan tests => 31;
13
14 ok(my $db = WAIT::Database->create(name => 'test'), "create");
15
16 ok(my $tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table");
17
18 use Data::Dumper;
19 print Dumper($tb);
20
21 ok($db->drop_table(name => 'sample'), "drop_table");
22
23 ok (!$tb->drop, "tb->drop");
24
25 ok ($tb = $db->create_table(name => 'sample', attr => ['docid', 'term']), "create_table");
26
27 ok($tb->open, "tb->open");
28
29 ok($tb->close, "tb->close");
30
31 ok(defined $tb,"defined tb");
32
33 ok($db->close, "db->close");
34
35 ok($db = WAIT::Database->open(name => 'test'), "open");
36
37 ok($tb = $db->table(name => 'sample'), "db->table");
38
39 ok($tb->open, "tb->open");
40
41 ok($tb->set(top=>1), "tb->set(top=>1)");
42
43 ok($tb->drop, "tb->drop");
44 ok(!defined $tb, "undef tb");
45
46 # clean up
47 ok($db->dispose, "dispose");
48 ok(!defined $db, "undef db");
49
50

Properties

Name Value
cvs2svn:cvs-rev 1.1.1.2

  ViewVC Help
Powered by ViewVC 1.1.26