forked from lix-project/hydra
t/Helper/CatalystUtils.t: test trim functionality
This commit is contained in:
parent
d56815cae6
commit
085b02e092
28
t/Helper/CatalystUtils.t
Normal file
28
t/Helper/CatalystUtils.t
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Setup;
|
||||||
|
use Test2::V0;
|
||||||
|
use Hydra::Helper::CatalystUtils;
|
||||||
|
|
||||||
|
subtest "trim" => sub {
|
||||||
|
my %values = (
|
||||||
|
"" => "",
|
||||||
|
"🌮" => '🌮',
|
||||||
|
" 🌮" => '🌮',
|
||||||
|
"🌮 " => '🌮',
|
||||||
|
" 🌮 " => '🌮',
|
||||||
|
"\n🌮 " => '🌮',
|
||||||
|
"\n\t🌮\n\n\t" => '🌮',
|
||||||
|
);
|
||||||
|
|
||||||
|
for my $input (keys %values) {
|
||||||
|
my $value = $values{$input};
|
||||||
|
is(trim($input), $value, "Trim the value: " . $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
my $uninitialized;
|
||||||
|
|
||||||
|
is(trim($uninitialized), '', "Trimming an uninitialized value");
|
||||||
|
};
|
||||||
|
|
||||||
|
done_testing;
|
Loading…
Reference in a new issue