1use Test::More; 2use strict; use warnings FATAL => 'all'; 3 4use List::Objects::WithUtils 'array'; 5 6my $arr = array( 1 .. 10 ); 7 8my $pair = $arr->bisect(sub { $_ >= 5 }); 9 10isa_ok $pair, 'List::Objects::WithUtils::Array', 11 'bisect returned array obj'; 12 13ok $pair->count == 2, 'bisect() returned two items'; 14isa_ok $pair->get(0), 'List::Objects::WithUtils::Array'; 15isa_ok $pair->get(1), 'List::Objects::WithUtils::Array'; 16 17is_deeply [ $pair->get(0)->all ], [ 5 .. 10 ]; 18is_deeply [ $pair->get(1)->all ], [ 1 .. 4 ]; 19 20ok array()->bisect(sub {})->count == 2, 'bisect always returns two arrays'; 21 22done_testing; 23