@@ -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)
@@ -230,6 +230,13 @@ sf_uncons p = (uncons . L.filter p) `eqP`
230 (fmap (second unpackS) . S.uncons . S.filter p)
230 (fmap (second unpackS) . S.uncons . S.filter p)
231t_uncons = uncons `eqP` (fmap (second unpackS) . T.uncons)
231t_uncons = uncons `eqP` (fmap (second unpackS) . T.uncons)
232tl_uncons = uncons `eqP` (fmap (second unpackS) . TL.uncons)
232tl_uncons = uncons `eqP` (fmap (second unpackS) . TL.uncons)
234+unsnoc xs@(_:_) = Just (init xs, last xs)
237+t_unsnoc = unsnoc `eqP` (fmap (first unpackS) . T.unsnoc)
238+tl_unsnoc = unsnoc `eqP` (fmap (first unpackS) . TL.unsnoc)
233s_head = head `eqP` S.head
240s_head = head `eqP` S.head
234sf_head p = (head . L.filter p) `eqP` (S.head . S.filter p)
241sf_head p = (head . L.filter p) `eqP` (S.head . S.filter p)
235t_head = head `eqP` T.head
242t_head = head `eqP` T.head
@@ -976,6 +983,8 @@ tests =
976 testProperty "sf_uncons" sf_uncons,
983 testProperty "sf_uncons" sf_uncons,
977 testProperty "t_uncons" t_uncons,
984 testProperty "t_uncons" t_uncons,
978 testProperty "tl_uncons" tl_uncons,
985 testProperty "tl_uncons" tl_uncons,
986+ testProperty "t_unsnoc" t_unsnoc,
987+ testProperty "tl_unsnoc" tl_unsnoc,
979 testProperty "s_head" s_head,
988 testProperty "s_head" s_head,
980 testProperty "sf_head" sf_head,
989 testProperty "sf_head" sf_head,
981 testProperty "t_head" t_head,
990 testProperty "t_head" t_head,