diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2016-01-19 22:01:45 +0000 |
---|---|---|
committer | Martin Pärtel <martin.partel@gmail.com> | 2016-01-19 22:01:45 +0000 |
commit | f28bcef652a4f8724acb1d9961902adb85fc55d2 (patch) | |
tree | a48113d5cf710050e73d1330845192efe0a9d9b9 /tests/test_bindfs.rb | |
parent | 7d3c41a881d746ea9a18f56910bb7bdb633f00cc (diff) | |
download | bindfs-f28bcef652a4f8724acb1d9961902adb85fc55d2.tar.gz |
Added a test case for reading the entries of a large directory.
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-x | tests/test_bindfs.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |