@@ -9,7 +9,7 @@ module Tests.Properties
11import Control.Applicative ((<$>), (<*>))
11import Control.Applicative ((<$>), (<*>))
12−import Control.Arrow ((***), second)
12+import Control.Arrow ((***), first, second)
13import Data.Bits ((.&.))
13import Data.Bits ((.&.))
14import Data.Char (chr, isDigit, isHexDigit, isLower, isSpace, isLetter, isUpper, ord)
14import Data.Char (chr, isDigit, isHexDigit, isLower, isSpace, isLetter, isUpper, ord)
15import Data.Int (Int8, Int16, Int32, Int64)
15import Data.Int (Int8, Int16, Int32, Int64)
@@ -232,6 +232,13 @@ sf_uncons p = (uncons . L.filter p) `eqP`
232 (fmap (second unpackS) . S.uncons . S.filter p)
232 (fmap (second unpackS) . S.uncons . S.filter p)
233t_uncons = uncons `eqP` (fmap (second unpackS) . T.uncons)
233t_uncons = uncons `eqP` (fmap (second unpackS) . T.uncons)
234tl_uncons = uncons `eqP` (fmap (second unpackS) . TL.uncons)
234tl_uncons = uncons `eqP` (fmap (second unpackS) . TL.uncons)
236+unsnoc xs@(_:_) = Just (init xs, last xs)
239+t_unsnoc = unsnoc `eqP` (fmap (first unpackS) . T.unsnoc)
240+tl_unsnoc = unsnoc `eqP` (fmap (first unpackS) . TL.unsnoc)
235s_head = head `eqP` S.head
242s_head = head `eqP` S.head
236sf_head p = (head . L.filter p) `eqP` (S.head . S.filter p)
243sf_head p = (head . L.filter p) `eqP` (S.head . S.filter p)
237t_head = head `eqP` T.head
244t_head = head `eqP` T.head
@@ -991,6 +998,8 @@ tests =
991 testProperty "sf_uncons" sf_uncons,
998 testProperty "sf_uncons" sf_uncons,
992 testProperty "t_uncons" t_uncons,
999 testProperty "t_uncons" t_uncons,
993 testProperty "tl_uncons" tl_uncons,
1000 testProperty "tl_uncons" tl_uncons,
1001+ testProperty "t_unsnoc" t_unsnoc,
1002+ testProperty "tl_unsnoc" tl_unsnoc,
994 testProperty "s_head" s_head,
1003 testProperty "s_head" s_head,
995 testProperty "sf_head" sf_head,
1004 testProperty "sf_head" sf_head,
996 testProperty "t_head" t_head,
1005 testProperty "t_head" t_head,