Open HiPhish opened 4 months ago
Thank you for your response. I have amended the commit message.
We should probably add a test.
Maybe I am missing something here, but it does not look like there are any loader tests. There is the file spec/modules/file_loader_spec.lua
, but all it does is require and call a module, but it does not do anything with the results.
and maybe make it an optional test for local testing for folks that don't have Fennel setup.
That's simple enough, we can pcall(require, 'fennel')
in the test; if the call errors then Fennel is not available and we can skip the Fennel loader.
I don't have any Fennel expertise
Fennel is pretty much just Lua with Lisp notation (some special forms plus a macro system), so it maps very closely to Lua.
I just pushed an update that does two things:
compileString
inside a pcall
in case there is a syntax error in the Fennel fileloadfile_
has actually succeededPreviously the code was working under the assumption that compilation would always succeed.
feel free to poke again if this falls off my radar
poke @alerque
poke @alerque
Closes #738
Tests can be written in Fennel if
fennel
is among the loaders. Currently the traceback is wrong for failures and pending tests, but it is wrong for tests written in Moonscript as well, so this seems to be a general problem with busted.It would have been cool if we could make
it
,describe
and so on into macros to not have to manually wrap the test body inside a thunk every time.This macro can accomplish it when added to the beginning of a test:
However, the source map produces rather weird mappings from Lua to Fennel (it maps the assertion to the body of the macro definition), so for now I won't pursue this.