Commit | Line | Data |
fde3db1a |
1 | #!/usr/bin/perl -l |
2 | |
3 | ## |
4 | # DBM::Deep Test |
5 | # |
6 | # Test for interference from -l on the commandline. |
7 | ## |
8 | use strict; |
9 | use Test::More tests => 4; |
10 | use Test::Exception; |
11 | use t::common qw( new_fh ); |
12 | |
13 | use_ok( 'DBM::Deep' ); |
14 | |
15 | my ($fh, $filename) = new_fh(); |
16 | my $db = DBM::Deep->new( $filename ); |
17 | |
18 | ## |
19 | # put/get key |
20 | ## |
21 | $db->{key1} = "value1"; |
22 | is( $db->get("key1"), "value1", "get() works with hash assignment" ); |
23 | is( $db->fetch("key1"), "value1", "... fetch() works with hash assignment" ); |
24 | is( $db->{key1}, "value1", "... and hash-access also works" ); |