File: synopsis.t

package info (click to toggle)
libstring-flogger-perl 1.101242-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 116 kB
  • sloc: perl: 121; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (5)
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
#!perl
use strict;
use warnings;
use Test::More tests => 5;
use String::Flogger qw(flog);

is(
  flog('simple!'),
  'simple!',
);

is(
  flog([ 'slightly %s complex', 'more' ]),
  'slightly more complex',
);

is(
  flog([ 'and inline some data: %s', { look => 'data!' } ]),
  'and inline some data: {{{"look": "data!"}}}',
);

is(
  flog([ 'and we can defer evaluation of %s if we want', sub { 'stuff' } ]),
  'and we can defer evaluation of stuff if we want',
);

is(
  flog(sub { 'while avoiding sprintfiness, if needed' }),
  'while avoiding sprintfiness, if needed',
);