/[wait]/trunk/t/database.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/database.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (show annotations)
Tue Jul 13 19:05:31 2004 UTC (19 years, 10 months ago) by dpavlin
File MIME type: application/x-troff
File size: 958 byte(s)
come cleanup

1 #!/usr/bin/perl -w
2 #
3 # test WAIT::Database
4
5 use strict;
6 use Test::More;
7 use Test::Exception;
8 use File::Path qw(rmtree);
9 use lib '/data/wait2/lib';
10 use blib;
11
12 BEGIN { use_ok('WAIT::Database'); }
13
14 plan tests => 10;
15
16 my $db;
17
18 if (-e './test') {
19 warn "test directory exists, removing!\n";
20 rmtree('./test',0,1);
21 }
22
23 ok($db = WAIT::Database->create(name => 'test'), "create");
24
25 ok($db->close, "close");
26
27 ok(!defined($db), "object empty");
28
29 ok($db = WAIT::Database->open(name => 'test'), "open");
30
31 ok(!$db->sync, "sync without tables");
32
33 # can't test this
34 #undef $WAIT::Database::self;
35 #ok(!defined($WAIT::Database::self) , 'undef $WAIT::Database::self');
36
37 ok($db->dispose, "dispose");
38
39 ok(! $db, '$db empty');
40
41 {
42 my $db = WAIT::Database->create(name => 'test');
43 $db->close();
44 }
45
46 ok(!defined($db), "create+close");
47
48 ok(WAIT::Database->dispose(name => 'test'), "dispose");
49
50 ok(!defined($db = WAIT::Database->open(name => 'test')), "open non-existing database");
51

Properties

Name Value
cvs2svn:cvs-rev 1.1

  ViewVC Help
Powered by ViewVC 1.1.26