1use Test::More; 2use strict; use warnings FATAL => 'all'; 3 4use List::Objects::WithUtils 'array'; 5 6my $empty = array->rotator; 7ok !defined $empty->(), 'empty rotator ok'; 8 9my $rotator = array(1, 2, 3)->rotator; 10 11my @vals = map {; $rotator->() } 1 .. 7; 12is_deeply 13 [ @vals ], 14 [ 1, 2, 3, 1, 2, 3, 1 ], 15 'rotator ok'; 16 17done_testing 18