Skip to content

Language Haskell

kazk edited this page Jun 16, 2020 · 6 revisions

Versions

Test Frameworks

GHC 7.10.3

Codewars (wraps Hspec)

GHC 8.2.2

Hspec

Note that tests written for 7.10.3 are not compatible with 8.2.2.

module ExampleSpec where

import Test.Hspec
import Example

spec :: Spec
spec = do
    describe "add" $ do
        it "adds Nums" $ do
            (add 1 1) `shouldBe` (2 :: Integer)

-- Adding the following line might make this compatible with 7.10
main = hspec spec

The test module's name must end with Spec. Spec by itself is not allowed. Examples: ExampleSpec, Example.ExampleSpec are allowed while Spec, Example.Spec, ExampleTest, Example.KataTest are not.

The common convention is: If the solution's module name is e.g. YourKata.SomeTask, just add Spec to the end without a dot, e.g. YourKata.SomeTaskSpec.

Timeout

12 seconds

Packages

GHC 7.10.3

  • esqualeto
  • haskell-src-exts
  • ifelse
  • lens
  • parsec
  • persistent-sqlite
  • persistent-template
  • split

GHC 8.2.2

  • split
  • lens
  • transformers
  • mtl
  • text
  • vector
  • random
  • parsec
  • megaparsec
    • hspec-megaparsec
  • attoparsec
    • hspec-attoparsec
  • regex-pcre
  • regex-tdfa
  • regex-posix
  • hspec
  • hspec-codewars
  • hspec-contrib
  • HUnit-approx
  • haskell-src-exts

Services

None

Language ID

haskell

Clone this wiki locally