I have src/Main.hs define the Main
module and tests/Tests.hs import the Main
module. Why does cabal build
tell me module 'Main' (tests/Tests.hs) imports itself
?
Did you give Tests
a module header?
module Tests where
import Main
-- ...
Also, depending on the testing framework, test suites are usually run as a standalone executable with their own main
, importing common modules that Main
also uses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With