Skip to content

Language Haskell

kazk edited this page Jan 14, 2021 · 6 revisions

Versions

Test Frameworks

Hspec

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)

-- Optional
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 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

GHC 8.8.4

# From package.yaml
# See https://www.stackage.org/lts-16.25 for versions
dependencies:
- base >= 4.7 && < 5
- attoparsec
- haskell-src-exts
- hspec
- hspec-attoparsec
- hspec-codewars # https://github.com/codewars/hspec-codewars
- hspec-contrib
- hspec-formatters-codewars
- hspec-megaparsec
- HUnit-approx
- lens
- megaparsec
- mtl
- parsec
- persistent
- persistent-sqlite
- persistent-template
- random
- regex-pcre
- regex-posix
- regex-tdfa
- split
- text
- transformers
- vector

Services

None

Language ID

haskell

Clone this wiki locally