Skip to content

Commit

Permalink
Add a consing/unconsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Nov 30, 2023
1 parent 273a21b commit d6a8014
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ main =
$ \(acc :: Acc Int) ->
Acc.toNonEmpty acc
=== NonEmpty.nonEmpty (toList acc),
testProperty "snoccing an unsnocced element of an acc produces the same acc"
testProperty "Snoccing an unsnocced element of an acc produces the same acc"
$ \(acc :: Acc Int) ->
case Acc.unsnoc acc of
Just (lastElement, prefix) ->
toList (Acc.snoc lastElement prefix) === toList acc
Nothing ->
discard,
testProperty "Consing an unconsed element of an acc produces the same acc"
$ \(acc :: Acc Int) ->
case Acc.uncons acc of
Just (firstElement, suffix) ->
toList (Acc.cons firstElement suffix) === toList acc
Nothing ->
discard,
testGroup "Issue #10"
$ [ testCase "" $ do
assertEqual
Expand Down

0 comments on commit d6a8014

Please sign in to comment.