Skip to content

Instantly share code, notes, and snippets.

@DigitalBrains1
Created January 29, 2022 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DigitalBrains1/b9ff10af0379f061d059e8c733b9e8e5 to your computer and use it in GitHub Desktop.
Save DigitalBrains1/b9ff10af0379f061d059e8c733b9e8e5 to your computer and use it in GitHub Desktop.
module DocTest where
-- | Problematic doctest example 1
--
-- >>> x = 1
-- >>> :{
-- x
-- :}
-- 1
-- >>> x
-- 1
f :: Int
f = 1
-- | Problematic doctest example 2
--
-- >>> :{
-- x = 1
-- :}
-- >>> x
-- 1
g :: Int
g = 1
-- | Working doctest example 1
--
-- >>> x = 1
-- >>> :{
-- x
-- :}
-- 1
--
-- >>> x
-- 1
h :: Int
h = 1
-- | Working doctest example 2
--
-- >>> :{
-- x = 1
-- :}
--
-- >>> x
-- 1
j :: Int
j = 1
[...]/DocTest.hs:6: failure in expression `:{
x
:}'
expected: 1
>>> x
1
but got: 1
^
[...]/DocTest.hs:17: failure in expression `:{
x = 1
:}'
expected: >>> x
1
but got: ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment