use strict;
use warnings;

use Test;

my %tests;
BEGIN {
    
    %tests = (
        'A man, a plan, a canal: Panama.'           => 1,
        'My dog has fleas'                          => 0,
        "Madam, I'm Adam."                          => 1,
        '1 on 1'                                    => 0,
        'In girum imus nocte et consumimur igni'    => 1,
        ''                                          => 1,
    );

    
    plan tests => (keys(%tests) * 4);
}

use Palindrome;

for my $key (keys %tests) {
    $_ = lc $key;  
    s/[\W_]//g;    

    my $expect = $tests{$key};
    my $note = ("\"$key\" should " . ($expect ? '' : 'not ') .
                "be a palindrome.");

    ok palindrome == $expect, 1, "palindrome: $note";
    ok palindrome_c == $expect, 1, "palindrome_c: $note";
    ok palindrome_r == $expect, 1, "palindrome_r: $note";
    ok palindrome_e == $expect, 1, "palindrome_e: $note";
}