leancheck-1.0.2: eg/test-list.hs
-- test-list.hs -- example program, testing Data.List using LeanCheck
--
-- Copyright (c) 2017-2024 Rudy Matela.
-- Distributed under the 3-Clause BSD licence (see the file LICENSE).
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
import Test.LeanCheck
import Data.List
main :: IO ()
main = do
-- three wrong properties about Data.List:
check $ \xs ys -> xs `union` ys == ys `union` (xs :: [Int])
check $ \xs -> [head xs] == take 1 (xs :: [Int])
check $ \xs -> head (sort xs :: [Int]) == minimum xs