aboutsummaryrefslogtreecommitdiff
path: root/challenge-273/iangoodnight/perl/t/task2.t
blob: 92563be8e31cd001931792dcf878453c2f396233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;
use autodie;
use Test::More;

use lib qw( . );

use task2 qw(b_after_a);

subtest 'Examples' => sub {
    plan tests => 4;

    is( b_after_a('aabb'), 1, 'Example 1' );
    is( b_after_a('abab'), 0, 'Example 2' );
    is( b_after_a('aaa'),  0, 'Example 3' );
    is( b_after_a('bbb'),  1, 'Example 4' );
};

subtest 'Additional tests' => sub {
    plan tests => 3;

    is( b_after_a('abbc'), 1, 'Characters other than "a" after "b"' );
    is( b_after_a(2),      0, 'Input other than strings' );
    is( b_after_a(),       0, 'No input' );
};

done_testing();