/[webpac2]/trunk/t/4-db.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

Diff of /trunk/t/4-db.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/t/4-db.tt revision 18 by dpavlin, Sun Jul 17 14:53:37 2005 UTC trunk/t/4-db.t revision 19 by dpavlin, Sun Jul 17 15:04:39 2005 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use Test::More tests => 22;  use Test::More tests => 23;
4  use Test::Exception;  use Test::Exception;
5  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
6  use blib;  use blib;
# Line 16  $abs_path =~ s#/[^/]*$#/#; Line 16  $abs_path =~ s#/[^/]*$#/#;
16  diag "abs_path: $abs_path";  diag "abs_path: $abs_path";
17    
18  my $db;  my $db;
19    my $debug = 1;
20    
21  diag "NULL DB";  diag "NULL DB";
22    
23  ok($db = new WebPAC::DB( debug => 1), "new");  ok($db = new WebPAC::DB( debug => $debug ), "new");
24    
25  ok(! $db->path, "path");  ok(! $db->path, "path");
26    
# Line 35  ok(my $path = tempdir(), "path"); Line 36  ok(my $path = tempdir(), "path");
36    
37  diag "DB path: $path";  diag "DB path: $path";
38    
39  ok($db = new WebPAC::DB( path => $path, debug => 1), "new");  ok($db = new WebPAC::DB( path => $path, debug => $debug ), "new");
40    
41  cmp_ok($db->{'path'}, 'eq', $path, "path");  cmp_ok($db->{'path'}, 'eq', $path, "path");
42    
43  ok(! $db->path, "path - disable caching");  ok(! $db->path(''), "path - disable caching");
44    
45  cmp_ok($db->{'path'}, '==', undef, "no path");  cmp_ok($db->{'path'}, '==', undef, "no path");
46    
47  ok($db->path( $path ), "path($path)");  ok($db->path( $path ), "path($path)");
48    
49    cmp_ok($db->{'path'}, 'eq', $path, "path");
50    
51  ok(! $db->load_gs(), 'load_gs');  ok(! $db->load_gs(), 'load_gs');
52  ok(! $db->load_gs({ '000' => '000' }), 'load_gs');  ok(! $db->load_gs({ '000' => '000' }), 'load_gs');
53    

Legend:
Removed from v.18  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26