1use Test::More; 2use strict; use warnings FATAL => 'all'; 3 4use Lowu; 5 6my $arr = [ 1 .. 10 ]; 7 8my $halved = $arr->nsect(2); 9 10isa_ok $halved, 'List::Objects::WithUtils::Array', 11 'boxed nsect returned array obj'; 12 13ok $halved->count == 2, 'boxed nsect(2) returned two items'; 14 15ok $halved->get(0)->count == $halved->get(1)->count, 16 'boxed nsect(2) on even set returned even sets'; 17 18is_deeply [ $halved->get(0)->all ], [ 1 .. 5 ], 19 'boxed nsect(2) first set ok' or diag explain $halved; 20is_deeply [ $halved->get(1)->all ], [ 6 .. 10 ], 21 'boxed nsect(2) second set ok' or diag explain $halved; 22 23done_testing; 24