-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last entry in multi-line table definition missed if there's no trailing comma #52
Comments
Hi @argos83! This problem in general is relatively difficult to detect: it's specific to LuaJIT IIRC, and simply filtering out misses on such lines is sometimes wrong because Does the problem go away when running luacov with cluacov installed? |
Hey @mpeterv, I've just tried with cluacov and the same issue occurs. |
That's strange. cluacov fixed it for me. What version of Lua/LuaJIT are you using? I see that the first line of your example is executed 11 times so it must be a part of a larger snippet, does the issue occur when running just the example? |
Hey @mpeterv. It also happens when running just the example:
I'm running lua in the context of OpenResty (v 1.11.2.2) compiled with |
Erm... I had the exact opposite issue, where the last line would be considered uncovered only if adding a trailing comma t = {
1 a.b,
1 a.c,
1 a.d,
**0 a.e,
1 } I guess I shouldn't open a new issue and add my case here instead? Did somebody send a PR trying to fix this issue, resulting in the opposite issue? |
Last line in multiline table considered as non-covered by luacov if it has no trailing comma. See more about the issue in luacov repo: lunarmodules/luacov#52 Based on PR #18 by @no1seman
Last line in multiline table considered as non-covered by luacov if it has no trailing comma. See more about the issue in luacov repo: lunarmodules/luacov#52 Based on PR #18 by @no1seman
Last entries line in multiline table considered as non-covered by luacov if it has no trailing comma. See more about the issue in luacov repo: lunarmodules/luacov#52 Based on PR #18 by @no1seman
Last entries line in multiline table considered as non-covered by luacov if it has no trailing comma. See more about the issue in luacov repo: lunarmodules/luacov#52 Based on PR #18 by @no1seman
Last entries line in multiline table considered as non-covered by luacov if it has no trailing comma. See more about the issue in luacov repo: lunarmodules/luacov#52 Based on PR #18 by @no1seman
Hi!
When defining a table in multiple lines, LuaCov misses coverage on the last entry unless it has a trailing comma.
E.g.
Without trailing comma:
With trailing comma:
Thanks for this great library!
The text was updated successfully, but these errors were encountered: