yesod で scaffolded サイトを作成すると、次のようにテストが別のディレクトリに配置されます。
YourProj/
YourProj/SomeModule.hs
YourProj/Handlers/FooHandler.hs
...
YourProj/tests/main.hs
YourProj/tests/FooTests.hs
だから、今私はghciを起動して、いくつかのコードをインポートしYourProj/tests/main.hs
たりYourProj/tests/FooTests.hs
、遊んだりしたいと思っています。どうすればいいのですか?私は試した:
cabal-dev ghci
> :set -itests
> :load tests/TestImport.hs
tests/TestImport.hs:15:8:
Could not find module `Control.Monad.IO.Class'
It is a member of the hidden package `transformers-0.3.0.0'.
Perhaps you need to add `transformers' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
build-depends
したがって、サブディレクトリの追加には成功しましたが、テスト スイートの cabal ファイルのパラメーターの cabal 構成が異なるため、まだ問題があります。
cabal-dev ghci を起動し、Yesod のテストからコードをインポートするにはどうすればよいですか?