Bump version to 2.1.1
[gnu-stow.git] / t / parent.t
blob2265f88315aeb8082efb3848702f18edbb364155
1 #!/usr/local/bin/perl
4 # Testing parent()
7 use strict;
8 use warnings;
10 use Stow::Util qw(parent);
12 use Test::More tests => 5;
14 is(
15 parent('a/b/c'),
16 'a/b'
17 => 'no leading or trailing /'
20 is(
21 parent('/a/b/c'),
22 '/a/b'
23 => 'leading /'
26 is(
27 parent('a/b/c/'),
28 'a/b'
29 => 'trailing /'
32 is(
33 parent('/////a///b///c///'),
34 '/a/b'
35 => 'multiple /'
38 is (
39 parent('a'),
41 => 'empty parent'