lunarmodules / luacov

LuaCov is a simple coverage analyzer for Lua code.
http://lunarmodules.github.io/luacov/
MIT License
300 stars 68 forks source link

Fix for codefromstring issue #17

Closed britzl closed 10 years ago

britzl commented 10 years ago

If codefromstrings configuration option is enabled the runner will always strip the first character of the filename even if it doesn’t begin with an @ sign

moteus commented 10 years ago

why so difficult :)

   if name:match("^@") then
      name = name:sub(2)
   elseif not runner.configuration.codefromstrings then
      return
   end

@hishamhm I do not like name codefromstrings. In fact we do not coverage code in strings but just use code string (in term of stock Lua) as file path. But I have no Idea about better name. At least please update comment in defaults.lua

britzl commented 10 years ago

@moteus Hehe, yeah that change looks a whole lot better. Not sure what went on in my brain when I wrote that :-)

britzl commented 10 years ago

Updated conditional to the one provided by @moteus

britzl commented 10 years ago

This was already fixed. Closing my own PR