bismuthsoft / super_rogue

Super Rogue
https://bismuthsoft.github.io/super_rogue/
Other
8 stars 0 forks source link

Testing #6

Closed winny- closed 1 year ago

winny- commented 1 year ago

We should add unit testing for core game stuff. It could make it easier to make sweeping changes down the line. And validate our math.

Possible frameworks

winny- commented 1 year ago

gambiarra injects bindings into the lua testing function's environment (a requirement of this library is all test must be wrapped in a function). The bindings are ok, spy, eq (code). This doesn't seem to play well with fennel because fennel's toolchain needs to track bindings across scope boundaries to emit closures correctly.

fennel-test assumes you're going to run tests against #!/usr/bin/env fennel using a carefully written test runner script. So we'd have to adapt or rewrite it for love2d. It might become more costly to create a "fennel-test-love2d" library than to consider another framework.

This leaves luaunit. It sees technomancy has used this to much success (code).

winny- commented 1 year ago

https://technomancy.us/180

winny- commented 1 year ago

Found yet another https://github.com/silentbicycle/lunatest . I think we should use luaunit so trying to integrate that at the moment.

winny- commented 1 year ago

we got testing :heavy_check_mark: