Create a helper for dealing with nested attribute sets
This commit is contained in:
@ -22,4 +22,23 @@ subtest "checking individual attribute set elements" => sub {
|
||||
}
|
||||
};
|
||||
|
||||
subtest "escaping path components of a nested attribute" => 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(escapeAttributePath($input), $value, "Escaping the attribute path: " . $input);
|
||||
}
|
||||
};
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user