This feature is coming around very nicely currently and will appear in the next version of elm-check.
This simple code:
test_list_length_positive =
test "Length of a list is always greater than 1"
(\ls -> List.length ls > 1)
(always True)
(list int)
100 (Random.initialSeed 12309)
test_reverse_append =
test2 "Append then reverse is equivalent to reversing then appending"
(\xs ys -> List.reverse (xs ++ ys))
(\xs ys -> List.reverse ys ++ List.reverse xs)
(list int)
(list int)
100 (Random.initialSeed 1)
tests =
Test.suite "List Tests"
[ test_list_length_positive
, test_reverse_append
]
main = runDisplay tests
is able to generate around 200 elm-test unit tests.
Shrinking is also supported as you may see from the screenshot. In the case of a failing unit test, a shrunk test case will be provided and will appear as the first unit test in the suite.
This feature is coming around very nicely currently and will appear in the next version of elm-check.
This simple code:
is able to generate around 200 elm-test unit tests.
Shrinking is also supported as you may see from the screenshot. In the case of a failing unit test, a shrunk test case will be provided and will appear as the first unit test in the suite.