File: 55m_name.t

package info (click to toggle)
libstring-print-perl 0.96-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: perl: 781; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env perl
# Test the 'undef default' modifier

use warnings;
use strict;
use utf8;

use Test::More;

use String::Print;

my $f = String::Print->new;
isa_ok($f, 'String::Print');

### these are all examples from the manual page

is $f->sprinti("visitors: {count=}", count => 1), "visitors: count=1", 'simple';
is $f->sprinti("visitors: {count%05d =}", count => 2), "visitors: count=00002", 'stack';
is $f->sprinti("visitors: {count %-8,d =}X", count => 10_000), "visitors: count=10,000  X";

done_testing;