Skip to main content

Idris

Status

Beta

Versions

1.3.x

Test Frameworks

specdris

Example

module Solution

%access export
%default total

add : Nat -> Nat -> Nat
add a b = a + b
module Solution

%access export
%default total

add : Nat -> Nat -> Nat
add a b = a + b
module SolutionSpec

import Specdris.Spec
import Solution

%access export
%default total

specSuite : IO ()
specSuite = spec $ do
  describe "add" $ do
    it "adds two natural numbers" $ do
      (1 `add` 1) `shouldBe` 2
module SolutionSpec

import Specdris.Spec
import Solution

%access export
%default total

specSuite : IO ()
specSuite = spec $ do
  describe "add" $ do
    it "adds two natural numbers" $ do
      (1 `add` 1) `shouldBe` 2

The test needs to export specSuite : IO () like in the official example.

The names of the module can be anything and the optional preloaded code will be just extra module.

Timeout

12 seconds

Packages

None

Services

None

Language ID

idris