4 use TAP::Formatter::Console;
11 in => sub {qw/2 7 1 3 10 9/},
12 out => sub {qw/1-3 7 9-10/},
13 name => '... and it should return numbers as ranges'
15 { method => '_balanced_range',
16 in => sub { 7, qw/2 7 1 3 10 9/ },
17 out => sub { '1-3, 7', '9-10' },
18 name => '... and it should return numbers as ranges'
22 plan tests => @schedule * 3;
25 for my $test (@schedule) {
26 my $name = $test->{name};
27 my $cons = TAP::Formatter::Console->new;
28 isa_ok $cons, 'TAP::Formatter::Console';
29 my $method = $test->{method};
30 can_ok $cons, $method;
31 is_deeply [ $cons->$method( $test->{in}->() ) ], [ $test->{out}->() ],
39 sub new { bless {}, shift }
43 my ( $self, $output, $color ) = @_;
44 $output->("[[$color]]");