From: rkinyon Date: Tue, 28 Feb 2006 18:45:08 +0000 (+0000) Subject: Added more tests on SPLICE X-Git-Tag: 0-99_01~122 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53fdf3d79d60c0a00ce46675c56d15bb8a6cfadc;hp=429e4192e1328c956eebea61f225a33e7909d101;p=dbsrgits%2FDBM-Deep.git Added more tests on SPLICE --- diff --git a/t/04_array.t b/t/04_array.t index 04a62bc..7398265 100644 --- a/t/04_array.t +++ b/t/04_array.t @@ -2,7 +2,7 @@ # DBM::Deep Test ## use strict; -use Test::More tests => 99; +use Test::More tests => 107; use Test::Exception; use_ok( 'DBM::Deep' ); @@ -189,6 +189,20 @@ is($db->[0], "elem first"); is($db->[1], "middle ABC"); is($db->[2], "elem last"); +@returned = $db->splice( 1 ); +is($db->length(), 1); +is($db->[0], "elem first"); +is($returned[0], "middle ABC"); +is($returned[1], "elem last"); + +$db->push( @returned ); + +@returned = $db->splice( 1, -1 ); +is($db->length(), 2); +is($db->[0], "elem first"); +is($db->[1], "elem last"); +is($returned[0], "middle ABC"); + # These tests verify that the hash methods cannot be called on arraytypes. # They will be removed once the ARRAY and HASH types are refactored into their own classes.