Permalink
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (35 sloc) 587 Bytes
#!perl
use strict;
use warnings;
use Test::More tests => 6;
use String::Flogger qw(flog);
is(
flog([ 'foo %s bar', undef ]),
'foo {{null}} bar',
"%s <- undef",
);
is(
flog([ 'foo %s bar', \undef ]),
'foo ref({{null}}) bar',
"%s <- \\undef",
);
is(
flog([ 'foo %s bar', \1 ]),
'foo ref(1) bar',
"%s <- \\1",
);
is(
flog([ 'foo %s bar', \\1 ]),
'foo ref(ref(1)) bar',
"%s <- \\\\1",
);
like(
flog({foo => 'bar'}),
qr/foo.+bar/,
"hashref keys/values printed",
);
like(
flog(sub { +{foo => 'bar'} }),
qr/foo.+bar/,
"hashref keys/values printed",
);