diff options
author | Dave Arter <davea@mysociety.org> | 2020-01-10 12:33:15 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-01-10 12:33:15 +0000 |
commit | 9bc7db869aba7d6321c89d0a92d9ece8b2b6a21c (patch) | |
tree | 44f4d535abeba0cbb49a766fe814f0c639b8f4f8 /t | |
parent | 6508407642869999c1659b5eb3ffbf71895151ea (diff) |
Cope with swapped operands in template operators
Perl may pass swapped operands to ensure the first one is always an object
that implements the relevant operator.
Diffstat (limited to 't')
-rw-r--r-- | t/template.t | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/template.t b/t/template.t index 1763a7f12..91e4ccc84 100644 --- a/t/template.t +++ b/t/template.t @@ -30,4 +30,10 @@ $tt->process(\'H: [% s.split(":").join(",") %]', { }, \$output); is $output, 'H: 1,sp<i>l</i>it,3'; +$output = ''; +$tt->process(\'[% size %] [% 100 / size %] [% size / 100 %]', { + size => 4 +}, \$output); +is $output, '4 25 0.04'; + done_testing; |