packages feed

hedis-tags 0.2.0 → 0.2.1

raw patch · 2 files changed

+11/−8 lines, 2 filesdep −QuickCheckdep −test-framework-quickcheck2PVP ok

version bump matches the API change (PVP)

Dependencies removed: QuickCheck, test-framework-quickcheck2

API changes (from Hackage documentation)

Files

hedis-tags.cabal view
@@ -1,5 +1,5 @@ name:           hedis-tags-version:        0.2.0
+version:        0.2.1
 cabal-version:  >= 1.8 build-type:     Simple stability:      Experimental@@ -31,9 +31,7 @@   build-depends:                       base >= 4,                    HUnit >= 1.2 && < 2,-                   QuickCheck >= 2.4,                    test-framework >= 0.4.1,-                   test-framework-quickcheck2,                    test-framework-hunit,                                       hedis-tags,
test/Database/Redis/Tags/Test/Tags.hs view
@@ -36,7 +36,7 @@     setup
     teardown
     $ runInRedis $ do
-        let expected = appendPrefix . scrap $ [1..9]
+        let expected = appendScrap [1..9]
         RT.markTags expected
                     allPrefix
                     (scrap [1..3])
@@ -51,7 +51,7 @@     setup
     teardown
     $ runInRedis $ do
-        let expected = appendPrefix . scrap $ [1..9]
+        let expected = appendScrap [1..9]
         let tags = appendPrefix . map (":tag:" `B.append`) $ scrap [1..3]
         RT.markTags expected
                     allPrefix
@@ -71,23 +71,25 @@     setup
     teardown
     $ runInRedis $ do
-        let expected = appendPrefix . scrap $ [1..9]
+        let expected = scrap9
         let tags = appendPrefix . map (":tag:" `B.append`) $ scrap [1..3]
         RT.markTags expected
                     allPrefix
                     (scrap [1..3])
-        void $ R.del $ appendPrefix . scrap $ [1..8]
+        void $ R.del $ appendScrap [1..8]
         RT.reconsileTags allPrefix
         t <- R.keys $ allPrefix `B.append` ":tag:*"
         k <- R.sunion tags
         liftIO $ Right tags @=? t
         liftIO $ Right ["redistags9"] @=? k
-        void $ R.del $ appendPrefix . scrap $ [1..9]
+        void $ R.del scrap9
         RT.reconsileTags allPrefix
         t' <- R.keys $ allPrefix `B.append` ":tag:*"
         k' <- R.sunion tags
         liftIO $ Right [] @=? t'
         liftIO $ Right [] @=? k'
+  where
+    scrap9 = appendScrap [1..9]
         
         
 runInRedis :: forall b. R.Redis b -> IO b
@@ -114,6 +116,9 @@ 
 appendPrefix :: [B.ByteString] -> [B.ByteString]
 appendPrefix = map (allPrefix `B.append`)
+
+appendScrap :: [Int] -> [B8.ByteString]
+appendScrap = appendPrefix . scrap
 
 allPrefix :: B.ByteString
 allPrefix = "redistags"