{"action":"created","issue":{"url":"https://api.github.com/repos/sol/doctest/issues/104","labels_url":"https://api.github.com/repos/sol/doctest/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/sol/doctest/issues/104/comments","events_url":"https://api.github.com/repos/sol/doctest/issues/104/events","html_url":"https://github.com/sol/doctest/issues/104","id":73402836,"number":104,"title":"Failure with cabal test","user":{"login":"fizruk","id":686582,"avatar_url":"https://avatars.githubusercontent.com/u/686582?v=3","gravatar_id":"","url":"https://api.github.com/users/fizruk","html_url":"https://github.com/fizruk","followers_url":"https://api.github.com/users/fizruk/followers","following_url":"https://api.github.com/users/fizruk/following{/other_user}","gists_url":"https://api.github.com/users/fizruk/gists{/gist_id}","starred_url":"https://api.github.com/users/fizruk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fizruk/subscriptions","organizations_url":"https://api.github.com/users/fizruk/orgs","repos_url":"https://api.github.com/users/fizruk/repos","events_url":"https://api.github.com/users/fizruk/events{/privacy}","received_events_url":"https://api.github.com/users/fizruk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-05-05T19:09:32Z","updated_at":"2015-11-02T15:42:21Z","closed_at":null,"body":"I am having trouble running `doctest` as a test suite via `cabal test`:\r\n\r\n```\r\n$ cabal test\r\nPreprocessing test suite 'examples' for arithmoi-0.4.1.2...\r\nRunning 1 test suites...\r\nTest suite examples: RUNNING...\r\n### Failure in /Users/nickolaykudasov/git/forks/arithmoi/Math/NumberTheory/GCD.hs:77: expression `binaryGCD x y == gcd x y'\r\n\r\n<interactive>:35:3:\r\n    No instance for (Show (Integer -> Integer -> Integer))\r\n      arising from a use of ‘Test.QuickCheck.Test.quickCheck’\r\n    In the expression:\r\n      Test.QuickCheck.Test.quickCheck\r\n        (doctest_prop ::\r\n           (Integer -> Integer -> Integer) -> Integer -> Integer -> Bool)\r\n    In an equation for ‘it’:\r\n        it\r\n          = Test.QuickCheck.Test.quickCheck\r\n              (doctest_prop ::\r\n                 (Integer -> Integer -> Integer) -> Integer -> Integer -> Bool)\r\nExamples: 1  Tried: 1  Errors: 0  Failures: 1\r\nTest suite examples: FAIL\r\nTest suite logged to: dist/test/arithmoi-0.4.1.2-examples.log\r\n0 of 1 test suites (0 of 1 test cases) passed.\r\n```\r\n\r\nThe `cabal test` command simply runs `doctest` for the source files:\r\n\r\n```haskell\r\n-- test-suite/DocTest.hs\r\nmodule Main (main) where\r\n\r\nimport           System.FilePath.Glob (glob)\r\nimport           Test.DocTest         (doctest)\r\n\r\nmain :: IO ()\r\nmain = glob \"Math/**/*.hs\" >>= doctest . (opts ++)\r\n\r\nopts :: [String]\r\nopts =\r\n  [ \"-optP-include\"\r\n  , \"-optPdist/build/autogen/cabal_macros.h\"\r\n  , \"-fobject-code\" ]\r\n```\r\n\r\nIf I just run the same `doctest` command from command line everything works just fine:\r\n\r\n```\r\n$ doctest -optP-include -optPdist/build/autogen/cabal_macros.h -fobject-code Math/**/*.hs\r\n### Failure in Math/NumberTheory/GCD.hs:77: expression `binaryGCD x y == gcd x y'\r\nFalsifiable (after 7 tests and 2 shrinks):\r\n3\r\n-6\r\nExamples: 1  Tried: 1  Errors: 0  Failures: 1\r\n```\r\n\r\nWhat can possibly cause this difference in behaviour?"},"comment":{"url":"https://api.github.com/repos/sol/doctest/issues/comments/153057154","html_url":"https://github.com/sol/doctest/issues/104#issuecomment-153057154","issue_url":"https://api.github.com/repos/sol/doctest/issues/104","id":153057154,"user":{"login":"ivanperez-keera","id":1162320,"avatar_url":"https://avatars.githubusercontent.com/u/1162320?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanperez-keera","html_url":"https://github.com/ivanperez-keera","followers_url":"https://api.github.com/users/ivanperez-keera/followers","following_url":"https://api.github.com/users/ivanperez-keera/following{/other_user}","gists_url":"https://api.github.com/users/ivanperez-keera/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanperez-keera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanperez-keera/subscriptions","organizations_url":"https://api.github.com/users/ivanperez-keera/orgs","repos_url":"https://api.github.com/users/ivanperez-keera/repos","events_url":"https://api.github.com/users/ivanperez-keera/events{/privacy}","received_events_url":"https://api.github.com/users/ivanperez-keera/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T15:42:21Z","updated_at":"2015-11-02T15:42:21Z","body":"Ok. I don't see why one works and the other doesn't, but it looks like you are getting a compilation error due to a missing instance. Different versions of the same package (one being picked by cabal, the other by doctest)? What happens if you run `cabal exec -- doctest <yourargs>`? Does it still work?\r\n\r\nThis is what actually helped me: What happens if you import `Text.Show.Functions` from the file where the property is defined, as follows?\r\n``` haskell\r\n-- $setup\r\n-- >>> import Text.Show.Functions\r\n```\r\nSee http://stackoverflow.com/a/10712276"}}