Function privacy and unit testing Haskell

后端 未结 2 688
陌清茗
陌清茗 2021-01-30 16:18

How do you deal with function visibility and unit testing in Haskell?

If you export every function in a module so that the unit tests have access to them, you risk other

2条回答
  •  鱼传尺愫
    2021-01-30 17:13

    For testing you normally split the application in the cabal project file, between a library, the production executable, and a test-suite executable that tests the library functions, so the test assertion functions are kept apart.

    For external function visibility you split the library modules between the "exposed-modules" section and the "other-modules" section.

提交回复
热议问题