aeson
aeson copied to clipboard
Question: adding a test, how-to?
I think I found a bug in Aeson. I want to contribute a fix. Before the fix, I want to prove that the bug exists with a failing unit test. How should do it? Should that regression test be a golden test? Some other test? Which modules I should look at first. Please advice :) I will be also happy to contribute a "How to contribute" guide for future generations to come :)
You can add unit tests here:
https://github.com/haskell/aeson/blob/master/tests/UnitTests.hs
Many of those are in fact regression tests for previously found bugs.
- Define your test as an
Assertion - Add it to
testswithtestCase
There are also golden tests for error messages:
https://github.com/haskell/aeson/blob/master/tests/ErrorMessages.hs
Adding more instructions in the contributors guide is a good idea.
Awesome! I will try to hack an example tomorrow. I will keep this issue open for now in case I have some questions. I will close it once the test is added and/or the contributors' guide is updated. Thanks @Lysxia