about summary refs log tree commit diff
path: root/users/grfn/xanthous/test/Xanthous/UtilSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'users/grfn/xanthous/test/Xanthous/UtilSpec.hs')
-rw-r--r--users/grfn/xanthous/test/Xanthous/UtilSpec.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/users/grfn/xanthous/test/Xanthous/UtilSpec.hs b/users/grfn/xanthous/test/Xanthous/UtilSpec.hs
index 01e8e402c5..0d6b718bc3 100644
--- a/users/grfn/xanthous/test/Xanthous/UtilSpec.hs
+++ b/users/grfn/xanthous/test/Xanthous/UtilSpec.hs
@@ -34,4 +34,10 @@ test = testGroup "Xanthous.Util"
     [ testCase "_1 += 1"
       $ execState (modifyKL _1 $ pure . succ) (1 :: Int, 2 :: Int) @?= (2, 2)
     ]
+  , testGroup "removeFirst"
+    [ testCase "example" $
+      removeFirst @[Int] (> 5) [1..10] @?= [1, 2, 3, 4, 5, 7, 8, 9, 10]
+    , testProperty "the result is the right length" $ \(xs :: [Int]) p ->
+        length (removeFirst p xs) `elem` [length xs, length xs - 1]
+    ]
   ]