-
Notifications
You must be signed in to change notification settings - Fork 221
Language Elm
kazk edited this page Jun 16, 2020
·
6 revisions
0.19
The name of the solution module can be anything. Extra module can be provided in preloaded section.
module Example exposing (..)
add : Int -> Int -> Int
add x y = x + y
module ExampleTest exposing (..)
import Expect exposing (Expectation)
import Test exposing (..)
import Example
suite : Test
suite =
describe "Example"
[ test "add" <|
\_ ->
Example.add 1 1
|> Expect.equal 2
]
Fuzz
can be used for property based testing:
module ExampleTest exposing (..)
import Expect exposing (Expectation)
import Test exposing (..)
import Fuzz
import Example
suite : Test
suite =
describe "Example"
[ fuzz2 Fuzz.int Fuzz.int "add" <|
\a b ->
Example.add a b
|> Expect.equal (a + b)
]
12 seconds
elm/core
elm-community/array-extra
elm-community/basics-extra
elm-community/dict-extra
elm-community/list-extra
elm-community/maybe-extra
elm-community/random-extra
elm-community/string-extra
elm-explorations/test
None
elm