diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua index 1fd6157..7111074 100644 --- a/tests/test.lua +++ b/tests/test.lua | |||
| @@ -110,4 +110,21 @@ for i = 1, 4000 do | |||
| 110 | count = count + 1 | 110 | count = count + 1 |
| 111 | end | 111 | end |
| 112 | end | 112 | end |
| 113 | |||
| 114 | -- Stressing directory iterator, explicit version | ||
| 115 | count = 0 | ||
| 116 | for i = 1, 4000 do | ||
| 117 | local iter, dir = lfs.dir(tmp) | ||
| 118 | local file = dir:next() | ||
| 119 | while file do | ||
| 120 | count = count + 1 | ||
| 121 | file = dir:next() | ||
| 122 | end | ||
| 123 | assert(not pcall(dir.next, dir)) | ||
| 124 | end | ||
| 125 | |||
| 126 | -- directory explicit close | ||
| 127 | local iter, dir = lfs.dir(tmp) | ||
| 128 | dir:close() | ||
| 129 | assert(not pcall(dir.next, dir)) | ||
| 113 | print"Ok!" | 130 | print"Ok!" |
