lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.4k stars 185 forks source link

Coverage report on moonscript code has many errors #595

Closed Sasszem closed 3 years ago

Sasszem commented 5 years ago

It falsely (and somehow randomly) reports:

Here's a few examples:

Assignment

  2 NataConfig = 
  2     groups: 
  2         all:  {},
  2         velocity: 
  2             filter: {'position', 'velocity'}
  2         despawn:
**0             filter: {'despawnTimer'}
  2     systems: {
  2         require "src.system.DespawnSystem"
  2     }

Function definition & assignment

   class Vec2
**0     new: (x=0, y=0) =>
**0         @x = x
  7         @y = y

Implicit return assignment

  8 @aim = aim
**0 @speed = 50
Tieske commented 5 years ago

LuaCov is used to track coverage. Since LuaCov is not Moonscript aware, my guess is that that is the culprit here. And if so, then there is no easy fix.

Probably best to document that Coverage is not supported with Moonscript.

Sasszem commented 5 years ago

Moon also has a coverage tool - maybe add an option to use it instead of luacov?

Tieske commented 5 years ago

PR's are welcome