0.97 ??? ?? ??:??:?? 2006 Pacific
- Reorganization of distribution
- Migration to Module::Build with EU::MM backwards compatibility
+ - Migration to Test::More (using Test::Exception)
- Test coverage improved to 89.6% (and climbing)
- The following methods have been renamed to reflect their private nature:
- init() is now _init()
- copy_node() is now _copy_node()
- throw_error() is now _throw_error()
- Added Devel::Cover report
+ - The various tied classes have been broken out. This means that testing
+ "ref( $obj ) eq 'DBM::Deep'" will now fail. The correct test is
+ "eval { $obj->isa( 'DBM::Deep' ) }".
+ - The various methods like push and delete now have the same return values as
+ the standard builtins.
0.96 Oct 14 09:55:00 2005 Pacific
- Fixed build (OS X hidden files killed it)
my $self = $_[0]->_get_self;
my $error_text = $_[1];
- $self->root->{error} = $error_text;
+ if ( Scalar::Util::blessed $self ) {
+ $self->root->{error} = $error_text;
- unless ($self->root->{debug}) {
+ unless ($self->root->{debug}) {
+ die "DBM::Deep: $error_text\n";
+ }
+
+ warn "DBM::Deep: $error_text\n";
+ return;
+ }
+ else {
die "DBM::Deep: $error_text\n";
}
-
- warn "DBM::Deep: $error_text\n";
- return;
}
sub clear_error {
# DBM::Deep Test
##
use strict;
-use Test::More;
-BEGIN { plan tests => 10 }
+use Test::More tests => 11;
+use Test::Exception;
-use DBM::Deep;
+use_ok( 'DBM::Deep' );
##
# testing the various modes of opening a file
# They should be doing (Scalar::Util::reftype($_[0]) eq 'HASH') and then
# erroring out if it's not.
TODO: {
- todo_skip "Naive use of ref()", 1;
+ todo_skip( "Naive use of {\@_}", 1 );
unlink "t/test.db";
my %hash;
my $db = tie %hash, 'DBM::Deep', [
}
TODO: {
- todo_skip "Naive use of ref()", 1;
+ todo_skip( "Naive use of {\@_}", 1 );
unlink "t/test.db";
my @array;
my $db = tie @array, 'DBM::Deep', [
else { ok(1); }
}
-# These are testing the naive use of the {@_} construct within TIEHASH and
-# TIEARRAY. Instead, they should be checking (@_ % 2 == 0) and erroring out
-# if it's not.
-TODO: {
- todo_skip( "Naive use of {\@_}", 1 );
- unlink "t/test.db";
- my %hash;
- my $db = tie %hash, 'DBM::Deep',
- undef, file => 't/test.db'
- ;
-
- if ($db->error()) {
- print "ERROR: " . $db->error();
- ok(0);
- exit(0);
- }
- else { ok(1); }
-}
-
-TODO: {
- todo_skip( "Naive use of {\@_}", 1 );
- unlink "t/test.db";
- my @array;
- my $db = tie @array, 'DBM::Deep',
- undef, file => 't/test.db'
- ;
+unlink "t/test.db";
+throws_ok {
+ tie my %hash, 'DBM::Deep', undef, file => 't/test.db';
+} qr/Odd number of parameters/, "Odd number of params to TIEHASH fails";
- if ($db->error()) {
- print "ERROR: " . $db->error();
- ok(0);
- exit(0);
- }
- else { ok(1); }
-}
+unlink "t/test.db";
+throws_ok {
+ tie my @array, 'DBM::Deep', undef, file => 't/test.db';
+} qr/Odd number of parameters/, "Odd number of params to TIEARRAY fails";