aboutsummaryrefslogtreecommitdiff
path: root/challenge-120/lance-wicks/perl/t/01-bits.t
blob: e2bc3e9414260d2f1cfdb9d1f5ddf3cd8538a346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use Test2::V0 -target => 'Bits';

subtest 'Example 1' => sub {
    is $CLASS->swap(101),154,'101 returns 154';
    note "Binary rep of 101 is '01100101' swapped is '10011010' -> 154 in decimal";
};

subtest 'Example 2' => sub {
    is $CLASS->swap(18),33,'18 returns 33';
    note "Binary rep of 18 is '00010010' swapped is '00100001' -> 33 in decimal";
};
done_testing;