File: 03.zero-number.t

package info (click to toggle)
libtext-autoformat-perl 1.750000-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 200 kB
  • sloc: perl: 745; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (2)
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
use utf8;
use strict;
use Test::More tests => 2;
use Text::Autoformat;

my $str = <<'END';
1. Analyze problem
0. Design algorithm
3. Code solution
END

my $after = autoformat $str, { lists => 'number', all => 1 }; 

is(
  $after,
  "1. Analyze problem\n2. Design algorithm\n3. Code solution\n",
  "do not lose 0 in list"
);

$str = <<'END';
4.0 Analyze problem
END

$after = autoformat $str, { lists => 'number', all => 1 }; 

is(
  $after,
  "4.0 Analyze problem\n",
  "do not lose 0 at end of list"
);