/[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 108 - (show annotations)
Tue Jul 13 17:41:12 2004 UTC (19 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 921 byte(s)
beginning of version 2.0 using BerkeleyDB (non-functional for now)

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 => 9;
14
15 my $db;
16
17 if (-e './test') {
18 warn "test directory exists, removing!\n";
19 rmtree('./test');
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->sync, "sync without tables");
31
32 # can't test this
33 #undef $WAIT::Database::self;
34 #ok(!defined($WAIT::Database::self) , 'undef $WAIT::Database::self');
35
36 ok($db->dispose, "dispose");
37
38 ok(! $db, '$db empty');
39
40 {
41 my $db = WAIT::Database->create(name => 'test');
42 $db->close();
43 }
44 ok(!defined($db), "create+close");
45
46 ok(WAIT::Database->dispose(name => 'test'), "dispose");
47
48 dies_ok { $db = WAIT::Database->open(name => 'test') } "open non-existing database";

Properties

Name Value
cvs2svn:cvs-rev 1.1

  ViewVC Help
Powered by ViewVC 1.1.26