Skip to content

Commit

Permalink
Item11385: making ListIterator more robust against degenerated list v…
Browse files Browse the repository at this point in the history
…alues, i.e. undef

git-svn-id: http://svn.foswiki.org/trunk@13622 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Jan 11, 2012
1 parent 86d99f8 commit 1fd33f3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion UnitTestContrib/test/unit/Iterator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sub test_ListIteratorWithUndef {
$this->assert_str_equals( '1, 2, 3, ', $b );
}

sub test_ListIterator_nothing {
sub test_ListIterator_nothing_hasNext {
my $this = shift;

my $it = new Foswiki::ListIterator();
Expand All @@ -81,6 +81,24 @@ sub test_ListIterator_nothing {
$this->assert_str_equals( '', $b );
}

sub test_ListIterator_nothing_all {
my $this = shift;

my $it = new Foswiki::ListIterator();
my @list = $it->all;

$this->assert_equals(0, scalar(@list));
}

sub test_ListIterator_nothing_skip {
my $this = shift;

my $it = new Foswiki::ListIterator();
my $count = $it->skip;

$this->assert_equals(0, $count);
}

sub test_AggregateIterator {
my $this = shift;

Expand Down

0 comments on commit 1fd33f3

Please sign in to comment.