Skip to content

Commit f5691ef

Browse files
committed
Create symlinked dir at runtime
It appears they cannot be added to a tar file, and thus are inhibiting release
1 parent 26492bb commit f5691ef

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

META6.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
],
4242
"test-depends": [
4343
],
44-
"version": "0.2.1"
44+
"version": "0.2.2"
4545
}

lib/File/Find.rakumod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ my sub find(
5858

5959
#- hack ------------------------------------------------------------------------
6060
# To allow version fetching in test files
61-
unit module File::Find:ver<0.2.1>:auth<zef:raku-community-modules>;
61+
unit module File::Find:ver<0.2.2>:auth<zef:raku-community-modules>;
6262

6363
# vim: expandtab shiftwidth=4

t/01-file-find.rakutest

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,28 @@ dies-ok { find(:dir<t/dir1>, :type<foo>) }, "dies on incorrect type";
7070
my $skip-first = True;
7171
my $throw = True;
7272

73-
#follow-symlinks
74-
$res = find(:dir<t/dir2>);
75-
@test = $res.map({ .Str }).sort;
76-
equals @test, <t/dir2/file.foo t/dir2/symdir t/dir2/symdir/empty_file t/dir2/symdir/file.bar>, 'follow-syminks is True';
73+
# follow-symlinks
74+
my $symlink-dir := $*PROGRAM.sibling("dir2/symdir");
75+
symlink($*PROGRAM.sibling("dir1/another_dir"), $symlink-dir);
76+
if $symlink-dir.e {
77+
$res = find(:dir<t/dir2>);
78+
@test = $res.map({ .Str }).sort;
79+
equals @test,
80+
<t/dir2/file.foo t/dir2/symdir t/dir2/symdir/empty_file t/dir2/symdir/file.bar>,
81+
'follow-syminks is True';
82+
83+
$res = find(:dir<t/dir2>, :!follow-symlinks);
84+
@test = $res.map({ .Str }).sort;
85+
equals @test,
86+
<t/dir2/file.foo t/dir2/symdir>,
87+
'follow-symlinks is False';
88+
89+
unlink $symlink-dir; # cleanup for the next test run, just in case
90+
}
7791

78-
$res = find(:dir<t/dir2>, follow-symlinks => False);
79-
@test = $res.map({ .Str }).sort;
80-
equals @test, <t/dir2/file.foo t/dir2/symdir>, 'follow-symlinks is False';
92+
else {
93+
pass "Cannot check symlinks on dirs in this OS" for ^2;
94+
}
8195

8296
# Wrap dir to throw when we want it to.
8397
my $w = &dir.wrap(sub ($_) {

t/dir2/symdir

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)