File: 01_basic.t

package info (click to toggle)
libdbm-deep-perl 2.0008-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 884 kB
  • sloc: perl: 7,383; sql: 36
file content (30 lines) | stat: -rw-r--r-- 562 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use strict;
use warnings FATAL => 'all';

use Test::More;

use t::common qw( new_fh );

diag "Testing DBM::Deep against Perl $] located at $^X";

use_ok( 'DBM::Deep' );

##
# basic file open
##
my ($fh, $filename) = new_fh();
my $db = eval {
    local $SIG{__DIE__};
    DBM::Deep->new( $filename );
}; if ( $@ ) {
	diag "ERROR: $@";
    Test::More->builder->BAIL_OUT( "Opening a new file fails." );
}

isa_ok( $db, 'DBM::Deep' );
ok(1, "We can successfully open a file!" );

$db->{foo} = 'bar';
is( $db->{foo}, 'bar', 'We can write and read.' );

done_testing;