@@ -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
@@ -996,6 +1003,8 @@ tests =
996 testProperty "sf_uncons" sf_uncons,
1003 testProperty "sf_uncons" sf_uncons,
997 testProperty "t_uncons" t_uncons,
1004 testProperty "t_uncons" t_uncons,
998 testProperty "tl_uncons" tl_uncons,
1005 testProperty "tl_uncons" tl_uncons,
1006+ testProperty "t_unsnoc" t_unsnoc,
1007+ testProperty "tl_unsnoc" tl_unsnoc,
999 testProperty "s_head" s_head,
1008 testProperty "s_head" s_head,
1000 testProperty "sf_head" sf_head,
1009 testProperty "sf_head" sf_head,
1001 testProperty "t_head" t_head,
1010 testProperty "t_head" t_head,