Subject: | Unexpected behavior when with getPrevious() method from the BiDirectional interator |
Date: | Fri, 10 Aug 2018 12:20:39 +0200 |
To: | bug-Array-Iterator [...] rt.cpan.org |
From: | Declercq Laurent <l.declercq [...] nuxwin.com> |
Good morning,
Either I'm totally crazy, either the BiDirectional iterator is totally
broken.
my @set = qw/ one two three four /:
my $iterator = Array::Iterator::BiDirectional->new(@set);
Current behavior
print $iterator->getNext() . "\n"; # one
print $iterator->getNext() . "\n"; # two
print $iterator->getNext() . "\n"; # three
print $iterator->getPrevious() . "\n"; # three
print $iterator->getPrevious() . "\n"; # two
Expected behavior
print $iterator->getNext() . "\n"; # one
print $iterator->getNext() . "\n"; # two
print $iterator->getNext() . "\n"; # three
print $iterator->getPrevious() . "\n"; # two
print $iterator->getPrevious() . "\n"; # one
Environment
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.11 (jessie)
Release: 8.11
Codename: jessie
# perl --version
This is perl 5, version 20, subversion 2 (v5.20.2) built for
x86_64-linux-gnu-thread-multi
(with 102 registered patches, see perl -V for more detail)
Copyright 1987-2015, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Module version: 0.11
--
Laurent Declercq
iHMS/i-MSCP CEO & Lead Developer
------------------------------------------------------------------------
This message and any attachment are intended solely for the addressees
and are
confidential. iHMS/i-MSCP, including any part representing these
entities may
not be held responsible for their contents whose accuracy and
completeness cannot
be guaranteed over the Internet. Unauthorized use, disclosure,
distribution, copying,
or any part thereof is strictly prohibited. If you are not the intended
recipient of
this message, please notify the sender immediately and delete it.
------------------------------------------------------------------------
Message body is not shown because sender requested not to inline it.