use
Test::More;
{
package
testing::Role::CaseMap;
has
casemap
=> (
is
=>
'ro'
,
default
=>
sub
{
'ascii'
},
);
}
my
$o
= testing::Role::CaseMap->new;
can_ok(
$o
,
$_
)
for
qw/ lower upper equal /
;
cmp_ok(
$o
->lower(
'ABCdef{}'
),
'eq'
,
'abcdef{}'
,
'lower() ok'
);
cmp_ok(
$o
->upper(
'abc[]DEF'
),
'eq'
,
'ABC[]DEF'
,
'upper() ok'
);
ok(
$o
->equal(
'abc[]DEF'
,
'ABC[]def'
),
'equal() ok'
);
ok( !
$o
->equal(
'abcdef[]'
,
'abc[]def'
),
'!equal() ok'
);
done_testing;