ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/TDB_FileX/t/01_basic.t
Revision: 1.1
Committed: Fri Apr 25 16:43:02 2025 UTC (16 months, 4 weeks ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-0_97, HEAD
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #! /usr/bin/perl -w
2    
3     #
4     # test basic open/store/fetch (TDB_INTERNAL)
5     #
6    
7     use Test;
8     use Fcntl;
9    
10     BEGIN {plan tests => 4 };
11    
12     use TDB_FileX;
13     ok(1); # test loading
14    
15     my $tdb = TDB_FileX->open ("dummy.tdb", tdb_flags => TDB_FileX::INTERNAL, open_flags => O_RDWR, mode => 0664);
16    
17     ok($tdb);
18    
19     my $val = $tdb->fetch('foo');
20    
21     ok(not defined $val);
22    
23     $tdb->store(key1 => 'value1');
24     $tdb->store(key2 => 'value2', TDB_FileX::REPLACE);
25    
26     ok($tdb->fetch('key1'), 'value1');