File: 05-default.t

package info (click to toggle)
libstring-trim-perl 0.005-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 204 kB
  • sloc: perl: 180; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 427 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
use strict;
use warnings;
use Test::More 0.88;
use String::Trim;

my $trimmed;
my $untrimmed;
my $tests = 0;
while(<DATA>) {
    $untrimmed .= $_;
    trim;
    $trimmed .= $_;
    unlike($_, qr{^\s|\s$}, "trimmed line $tests OK");
    $tests++;
}
isnt($trimmed, $untrimmed, 'trim has some effect');
$tests++;
is($trimmed, 'onetwothreefour', 'trims $_ ok');
$tests++;

done_testing($tests);


__DATA__
 one
two   

three 
 four