forked from lix-project/hydra
26 lines
583 B
Perl
26 lines
583 B
Perl
|
use strict;
|
||
|
use Setup;
|
||
|
use Data::Dumper;
|
||
|
use Test2::V0;
|
||
|
use Hydra::Helper::Escape;
|
||
|
|
||
|
subtest "checking individual attribute set elements" => sub {
|
||
|
my %values = (
|
||
|
"" => '""',
|
||
|
"." => '"."',
|
||
|
"foobar" => '"foobar"',
|
||
|
"foo.bar" => '"foo.bar"',
|
||
|
"🌮" => '"🌮"',
|
||
|
'foo"bar' => '"foo\"bar"',
|
||
|
'foo\\bar' => '"foo\\\\bar"',
|
||
|
'$bar' => '"\\$bar"',
|
||
|
);
|
||
|
|
||
|
for my $input (keys %values) {
|
||
|
my $value = $values{$input};
|
||
|
is(escapeString($input), $value, "Escaping the value: " . $input);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
done_testing;
|