Skip to content

Commit 99a3246

Browse files
committed
Added test
1 parent 4aa0f1c commit 99a3246

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

Diff for: readdir_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,18 @@ func TestReadDirRecursiveLoopDetection(t *testing.T) {
303303
pathEqualsTo(t, "testdata/loops/regular_2/dir2/dir1/file1", l[4])
304304
pathEqualsTo(t, "testdata/loops/regular_2/dir2/file2", l[5])
305305
}
306+
307+
{
308+
l, err := unbuondedReaddir("regular_3")
309+
require.NoError(t, err)
310+
require.Len(t, l, 7)
311+
l.Sort()
312+
pathEqualsTo(t, "testdata/loops/regular_3/dir1", l[0])
313+
pathEqualsTo(t, "testdata/loops/regular_3/dir1/file1", l[1])
314+
pathEqualsTo(t, "testdata/loops/regular_3/dir2", l[2])
315+
pathEqualsTo(t, "testdata/loops/regular_3/dir2/dir1", l[3])
316+
pathEqualsTo(t, "testdata/loops/regular_3/dir2/dir1/file1", l[4])
317+
pathEqualsTo(t, "testdata/loops/regular_3/dir2/file2", l[5])
318+
pathEqualsTo(t, "testdata/loops/regular_3/link", l[6]) // broken symlink is reported in files
319+
}
306320
}

Diff for: testdata/loops/regular_3/dir1/file1

Whitespace-only changes.

Diff for: testdata/loops/regular_3/dir2/dir1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../dir1

Diff for: testdata/loops/regular_3/dir2/file2

Whitespace-only changes.

Diff for: testdata/loops/regular_3/link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
broken

0 commit comments

Comments
 (0)