From f28bcef652a4f8724acb1d9961902adb85fc55d2 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Tue, 19 Jan 2016 22:01:45 +0000 Subject: Added a test case for reading the entries of a large directory. --- tests/test_bindfs.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index 5da0c10..3e31538 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -559,6 +559,18 @@ nonroot_testenv("--resolve-symlinks --resolved-symlink-deletion=target-first -p end end +# Issue #28 reproduction attempt. +testenv("", :title => "many files in a directory") do + mkdir('src/dir') + expected_entries = ['.', '..'] + 10000.times do |i| + touch("src/dir/#{i}") + expected_entries << i.to_s + end + + assert { Dir.entries('mnt/dir').sort == expected_entries.sort } +end + # FIXME: this stuff around testenv is a hax, and testenv may also exit(), which defeats the 'ensure' below. # the test setup ought to be refactored. It might well use MiniTest or something. if Process.uid == 0 -- cgit v1.2.3