Mani
Mani copied to clipboard
Setup Tests for Ci
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Let's create some unit tests for the features of this language. Simply so we know when we break something. An example of what we could do is:
load "munit";
let t = newTester();
t.header("Title of test suite");
t.assertEquals(1+2, 3, "testing 1 + 2");
Describe the solution you'd like A clear and concise description of what you want to happen.
We would create a custom testing framework in Máni to then use. As it will be a decent job to setup JUnit to do it.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Another solution would be to use JUnit. This will be a hard task as you will need to import certain features of Máni like the lexer, parser, resolver, and interpreter to get it to even work.
Additional context Add any other context or screenshots about the feature request here.
I'm keen to get involved with this project. I can have a go at creating some tests for this issue (I don't seem to be able to assign myself to the issue). It also may be an idea to create some proper testing framework at some point (maybe using JUnit if you're familiar)
Welcome to the team.
We would be more than happy for you to help.
Yeah, I have been tinkering with some testing frameworks in my own time lately, to see how to go about it for Mańi.
I will assign the issue to you.
Regards
Updating issue to reflect comments in closed PR:
- Tests now use testing library written in Mani (as per existing tests in test/)
- Test library needs documentation
Further tests need to be created for most of the features listed in the documentation.
I've also realised the tests I've been creating aren't fully independant - currently this doesn't matter as the Mani testing framework stops when a single test fails. However I would like to change tests at some point so they can all run independently (i.e. using test specific objects). Would also make it easier to debug and future proofs in case we change how tests run.
If it would make it easier. We could create a toggle of whether or not it will stop on fail.