Add functional testing #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since there is no automated test, I took the freedom to create a functional test with Cucumber (it runs through JUnit). These tests are nice to show how the lib satisfies some high level requirements. Here is the one I wrote:
To make it work, I needed to compile the code of the scenario to produce the JAR to analyze. This compiler and the test are the main outcomes of this pull request, and new scenarios can now be easily produced to properly test other parts of the lib.
Of course, the point is not simply to spend time testing the lib. The point was for me to set up a basis in order to investigate a nasty bug. Indeed, nested lambdas are not properly managed: we miss the link between the parent method and the lambda (
...:lambda$null$0(...)), so the call graph is broken. What I did here allowed me to make another scenario for that, so I can properly reproduce it and investigate. But it will come in another pull request when I solve it.