/[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 116 - (show annotations)
Wed Jul 14 09:48:26 2004 UTC (19 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1045 byte(s)
more fixes, more debug

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 blib;
10
11 BEGIN { use_ok('WAIT::Database'); }
12
13 plan tests => 12;
14
15 my $db;
16
17 if (-e './test') {
18 warn "test directory exists, removing!\n";
19 rmtree('./test',0,1);
20 }
21
22 ok($db = WAIT::Database->create(name => 'test'), "create");
23
24 ok($db->close, "close");
25
26 ok(!defined($db), "object empty");
27
28 ok($db = WAIT::Database->open(name => 'test'), "open");
29
30 ok(!$db || !$db->sync, "sync without tables");
31
32 undef $WAIT::Database::self;
33 ok(!defined($WAIT::Database::self) , 'undef distroy');
34
35 $db = WAIT::Database->open(name => 'test');
36 undef $db;
37 ok(!defined($db), 'undef obj');
38
39 $db = WAIT::Database->open(name => 'test');
40 ok($db->dispose, "dispose");
41
42 ok(!defined($db), '$db empty');
43
44 {
45 my $db = WAIT::Database->create(name => 'test');
46 $db->close();
47 }
48
49 ok(!defined($db), "create+close");
50
51 ok(WAIT::Database->dispose(name => 'test'), "dispose");
52
53 ok(!defined($db = WAIT::Database->open(name => 'test')), "open non-existing database");
54

Properties

Name Value
cvs2svn:cvs-rev 1.1

  ViewVC Help
Powered by ViewVC 1.1.26