{"action":"created","issue":{"url":"https://api.github.com/repos/sol/doctest/issues/95","labels_url":"https://api.github.com/repos/sol/doctest/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/sol/doctest/issues/95/comments","events_url":"https://api.github.com/repos/sol/doctest/issues/95/events","html_url":"https://github.com/sol/doctest/issues/95","id":53133986,"number":95,"title":"Import statements get counted as separate tests","user":{"login":"nikita-volkov","id":1560937,"avatar_url":"https://avatars.githubusercontent.com/u/1560937?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-volkov","html_url":"https://github.com/nikita-volkov","followers_url":"https://api.github.com/users/nikita-volkov/followers","following_url":"https://api.github.com/users/nikita-volkov/following{/other_user}","gists_url":"https://api.github.com/users/nikita-volkov/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-volkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-volkov/subscriptions","organizations_url":"https://api.github.com/users/nikita-volkov/orgs","repos_url":"https://api.github.com/users/nikita-volkov/repos","events_url":"https://api.github.com/users/nikita-volkov/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-volkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-30T18:01:10Z","updated_at":"2015-01-06T03:21:26Z","closed_at":null,"body":"I have only a single doctest, which is the following:\r\n\r\n```haskell\r\n-- >>> import qualified Data.Vector as V\r\n-- >>> import qualified Data.Vector.Unboxed as VU\r\n-- >>> streamValueDistributions $ V.fromList $ fmap VU.fromList $ [ [1, 2, 3], [2, 3], [2] ]\r\n-- [(2,3),(3,2),(1,1)]\r\n```\r\n\r\nExecuting doctest on it, produces the following summary:\r\n\r\n```\r\nExamples: 3  Tried: 3  Errors: 0  Failures: 0\r\n```\r\n\r\nVersion: doctest-0.9.11.1"},"comment":{"url":"https://api.github.com/repos/sol/doctest/issues/comments/68820997","html_url":"https://github.com/sol/doctest/issues/95#issuecomment-68820997","issue_url":"https://api.github.com/repos/sol/doctest/issues/95","id":68820997,"user":{"login":"sol","id":461132,"avatar_url":"https://avatars.githubusercontent.com/u/461132?v=3","gravatar_id":"","url":"https://api.github.com/users/sol","html_url":"https://github.com/sol","followers_url":"https://api.github.com/users/sol/followers","following_url":"https://api.github.com/users/sol/following{/other_user}","gists_url":"https://api.github.com/users/sol/gists{/gist_id}","starred_url":"https://api.github.com/users/sol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sol/subscriptions","organizations_url":"https://api.github.com/users/sol/orgs","repos_url":"https://api.github.com/users/sol/repos","events_url":"https://api.github.com/users/sol/events{/privacy}","received_events_url":"https://api.github.com/users/sol/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T03:21:26Z","updated_at":"2015-01-06T03:21:26Z","body":"@nikita-volkov Doctest is agnostic about what kind of statements you feed it.  So it can not differentiate import statements from expressions that produce output.  This has the advantage that\r\n\r\n> If something works with GHCi, it works with Doctest, too!\r\n\r\nWhat we could change is how we count examples.  Currently every line that starts with a `>>>` is counted as a example.  We could e.g. change that to count each Haddock comment as an example (regardless how many `>>>`s it contains).\r\n\r\nI'm not very opinionated about it, but I most likely will not invest any cycles in that myself.  But if somebody has a vision and wants to outline a different approach, let's go for it."}}