File: basic.t

package info (click to toggle)
libstring-flogger-perl 1.101245-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 140 kB
  • sloc: perl: 137; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 587 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!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",
);