File: 02-undef.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 (18 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use Test::More 0.94 tests => 2;
use Test::Builder 0.94 qw();
use String::Trim;

subtest 'return' => sub {
    plan tests => 1;
    my $trimmed = trim(undef);
    is($trimmed, undef, 'trim(undef) returns undef');
};

subtest 'in-place' => sub {
    plan tests => 1;
    my $to_trim = undef;
    trim($to_trim);
    is($to_trim, undef, 'undef trims to undef in-place');
};