Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the String-Errf CPAN distribution.

Report information
The Basics
Id: 83552
Status: resolved
Priority: 0/
Queue: String-Errf

People
Owner: Nobody in particular
Requestors: MJD [...] cpan.org
Cc: mjdominus [...] gmail.com
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.006
Fixed in: (no value)



CC: mjdominus [...] gmail.com
Subject: Neither diagnoses malformed templates nor continues gracefully, quietly producing nonsense output
use Test::More tests => 2; use String::Errf 0.006; use String::Errf 'errf'; my $payload = { total_amount => 1010, category => "sandwiches", limit => 1000, }; { # Here String::Errf could warn about a malformed format string, or it could produce # reasonable partial output, but it does neither. my $format = join(" ", "payment of \$%{total_amount}", "for category '%{category}s'", "over limit of \$%{limit;.2}f"); my $output = errf($format, $payload); isnt($output, 'payment of $\' over limit of $1000.00', "wat"); } { # Here String::Errf could warn about a malformed format string, or it could produce # reasonable partial output, but it does neither. my $format = join(" ", "payment of \$%{total_amount;.2}", "for category '%{category}s'", "over limit of \$%{limit;.2}f"); my $output = errf($format, $payload); like($output, qr/category.*sandwiches/, "where did the literal text 'category' go?"); }
I have made both of these into fatal errors. This is not my first choice, but it's better than what happens now. I think that I'd like to fix the way these are parsed in general. I have added https://github.com/rjbs/String-Errf/issues/2 -- rjbs