UnkindPartition / tasty-golden

Golden test support for Tasty
MIT License
36 stars 15 forks source link

Missing example in documentation #20

Closed alexanderkjeldaas closed 6 years ago

alexanderkjeldaas commented 7 years ago

The haddock documentation should probably include a minimal, typical example.

asr commented 7 years ago

Yes! Please include an example.

UnkindPartition commented 6 years ago

Hi, I have now published an introductory blog post containing a simple example and linked to it in the docs. Let me know if this is what you asked for.

I suppose I could add a trivial example to the haddocks, something like

import Test.Tasty (defaultMain)
import Test.Tasty.Golden (goldenVsString)
import Data.ByteString.Lazy.Char8 as LBS8

main :: IO ()
main = defaultMain $ goldenVsString
  "2+2" -- test name
  "example.txt" -- golden file path
  (return . LBS8.pack . show $ 2+2) -- action to produce the result

but I'm not sure this would be helpful.

asr commented 6 years ago

Thanks for writing the introductory blog post.

+1 for explicitly importing the identifiers.

UnkindPartition commented 6 years ago

Released an update that links to the blog post.