diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modules/os/test.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/modules/os/test.lua b/tests/modules/os/test.lua index 2dcab35c6..d24615fd4 100644 --- a/tests/modules/os/test.lua +++ b/tests/modules/os/test.lua @@ -208,3 +208,13 @@ function test_isexec(t) os.tryrm(tempdir) end + +function test_files_with_brackets(t) + local tmpdir = os.tmpfile() .. ".dir" + io.writefile(path.join(tmpdir, "a[1].lua"), "x") + io.writefile(path.join(tmpdir, "a1.lua"), "x") + -- a wildcard is required, a plain existing file is matched without converting the pattern + local files = os.files(path.join(tmpdir, "a[1]*.lua")) + t:are_equal(files, {path.join(tmpdir, "a[1].lua")}) + os.tryrm(tmpdir) +end |
