In other languages I like to put my unit tests in a different directory structure from the production code to keep things cleanly separated. Is there a typical convention in Haskell of how to do that or something similar?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is a typical convention codified at http://www.haskell.org/haskellwiki/Structure_of_a_Haskell_project.
Additionally, you can add the test build to the main cabal as in https://github.com/ekmett/speculation/blob/master/speculation.cabal
There are some bonuses to the separate cabal method. Namely that testing methods like the quickcheck generators for datatypes are available in a second project-test style cabal that others can import if they are using your data structures in their projects, but I prefer the single cabal approach. It depends on the purpose of your library though.
Haskell testing workflow is useful for more testing info.