repo.or.cz
/
gnu-stow.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Switch to renaming to manual via install hook as suggested by Stefano Lattarini
[gnu-stow.git]
/
t
/
parent.t
blob
2265f88315aeb8082efb3848702f18edbb364155
1
#!/usr/local/bin/perl
2
3
#
4
# Testing parent()
5
#
6
7
use
strict
;
8
use
warnings
;
9
10
use
Stow
::
Util
qw(parent)
;
11
12
use
Test
::
More tests
=>
5
;
13
14
is
(
15
parent
(
'a/b/c'
),
16
'a/b'
17
=>
'no leading or trailing /'
18
);
19
20
is
(
21
parent
(
'/a/b/c'
),
22
'/a/b'
23
=>
'leading /'
24
);
25
26
is
(
27
parent
(
'a/b/c/'
),
28
'a/b'
29
=>
'trailing /'
30
);
31
32
is
(
33
parent
(
'/////a///b///c///'
),
34
'/a/b'
35
=>
'multiple /'
36
);
37
38
is
(
39
parent
(
'a'
),
40
''
41
=>
'empty parent'
42
);
43