summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormpeterv <mpeterval@gmail.com>2016-04-18 15:06:39 +0300
committermpeterv <mpeterval@gmail.com>2016-04-18 15:10:46 +0300
commit59663e20d1d59b15c5032a64155e89d54e5d490a (patch)
tree8c8448f480cd11e249da2b27d5d4785f2c6d44f0
parent8fa9c4e050906fde4587a0fe0d8b25b8fe5c9e11 (diff)
downloadluacov-59663e20d1d59b15c5032a64155e89d54e5d490a.tar.gz
Port filefilter test for Windows
-rw-r--r--tests/filefilter.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/filefilter.lua b/tests/filefilter.lua
index d616839..2e988bd 100644
--- a/tests/filefilter.lua
+++ b/tests/filefilter.lua
@@ -1,5 +1,6 @@
--- Allow testing without installing,
-package.path = "src/?.lua;"..package.path
+local dir_sep = package.config:sub(1, 1)
+-- Allow testing without installing.
+package.path = "src" .. dir_sep .. "?.lua;"..package.path
local ntests = 0
@@ -21,7 +22,8 @@ local function test(config, files)
runner.load_config(config)
for _, filename in ipairs(filenames) do
- local expected = files[filename]
+ local expected = files[filename] and files[filename]:gsub("/", dir_sep)
+ filename = filename:gsub("/", dir_sep)
local actual = runner.file_included(filename) and runner.real_name(filename)
if actual ~= expected then