summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormpeterv <mpeterval@gmail.com>2016-04-17 13:16:50 +0300
committermpeterv <mpeterval@gmail.com>2016-04-17 13:16:50 +0300
commite5acbfe702183a8e19527b8e299f4f5bc08b930f (patch)
treeea19cc32f377f54454a3b6c42c2b52bf783fceb1
parenta644fa1834c00ecff86850e2a39ebc8937f39add (diff)
downloadluacov-e5acbfe702183a8e19527b8e299f4f5bc08b930f.tar.gz
Fix line filtering for `const}`
-rw-r--r--src/luacov/reporter.lua3
-rw-r--r--tests/linescanner.lua12
2 files changed, 14 insertions, 1 deletions
diff --git a/src/luacov/reporter.lua b/src/luacov/reporter.lua
index d2e1eaf..de11260 100644
--- a/src/luacov/reporter.lua
+++ b/src/luacov/reporter.lua
@@ -74,7 +74,8 @@ local zero_hits_exclusions = {
"} ?, ?function", -- same with "}, function(...)"
"break", -- "break" generates no trace in Lua 5.2+
"{", -- "{" opening table
- "}?[ %)]*", -- optional "{" closing table, possibly with several closing parens
+ "}?[ %)]*", -- optional closing paren, possibly with several closing parens
+ "[ntf0']+ ?}[ %)]*" -- a constant at the end of a table, possibly with closing parens (for LuaJIT)
}
local function excluded(exclusions, line)
diff --git a/tests/linescanner.lua b/tests/linescanner.lua
index 8d245e4..fcdfa3e 100644
--- a/tests/linescanner.lua
+++ b/tests/linescanner.lua
@@ -312,6 +312,18 @@ local f = { +
} ?
]=]
+-- Constants in tables.
+test [=[
+local t1 = { +
+ 1, ?
+ 2} ?
+local t2 = f({ +
+ 1, ?
+ false}) ?
+local t3 = { +
+ var} +
+]=]
+
-- Hanging table endings.
test [[
local v = f({ +