/[pub]/suikawiki/script/t/db-fs-swmeta09.t
Suika

Contents of /suikawiki/script/t/db-fs-swmeta09.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Thu Dec 4 07:23:22 2003 UTC (20 years, 11 months ago) by wakaba
Branch: MAIN
File MIME type: application/x-troff
New tests

1 wakaba 1.1 #!/usr/bin/perl
2     use strict;
3     use warnings;
4     use Test;
5     use FindBin q($Bin);
6     BEGIN {plan tests => 4}
7     use SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09;
8     use SuikaWiki::DB::Util::Error;
9    
10     my $dir = $Bin.'/db.tmp';
11     mkdir $dir or die "$0: $dir: $!" unless -d $dir;
12    
13     try {
14     my $db = new SuikaWiki::DB::FileSystem::SuikaWikiMetaInfo09
15     directory => $dir;
16    
17     $db->set (test => ['Key'] => 'Value');
18    
19     ok $db->get (test => ['Key']), 'Value';
20     ok $db->get (other => ['Key']), undef;
21     ok $db->get (test => ['other']), undef;
22    
23     $db->close;
24    
25     my $file = $db->{directory}.$db->{prefix}.$db->__encode_base16 ('test')
26     .$db->{suffix};
27     undef $db;
28    
29     ok -e $file, 1, 'Database is written on disk';
30     unlink $file or warn "$0: $file: $!";
31     } catch SuikaWiki::DB::Util::Error with {
32     warn shift->stringify;
33     };
34    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24