-
Notifications
You must be signed in to change notification settings - Fork 186
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
Implement loader for Fennel #740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first blush this looks like it's going to be fine. I don't have any Fennel expertise but it isn't like this is going to break anything else, and I don't expect any real reason to not include such a module if Fennel folks say it is useful.
I'll review details later this week (feel free to poke again if this falls off my radar), but to quick things:
- I've been roughly following the conventional commit spec, so this commit message should be
feat(core): Implement loader for Fennel
or something like that. - We should probably add a test. Somehow...obviously we're going to have a dependency problem with that but we can fix that in CI and maybe make it an optional test for local testing for folks that don't have Fennel setup. Is their prior art for testing our other loaders?
Thank you for your response. I have amended the commit message.
Maybe I am missing something here, but it does not look like there are any loader tests. There is the file
That's simple enough, we can
Fennel is pretty much just Lua with Lisp notation (some special forms plus a macro system), so it maps very closely to Lua. |
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.
I just pushed an update that does two things:
Previously the code was working under the assumption that compilation would always succeed. |
poke @alerque |
poke @alerque |
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.