packages feed

friday-juicypixels 0.1.2.2 → 0.1.2.3

raw patch · 3 files changed

+31/−35 lines, 3 filesnew-uploaderPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

friday-juicypixels.cabal view
@@ -1,5 +1,5 @@ name:                friday-juicypixels-version:             0.1.2.2+version:             0.1.2.3 synopsis:            Converts between the Friday and JuicyPixels image types description:         See <https://github.com/TomMD/friday-juicypixels#readme README> homepage:            github.com/TomMD/friday-juicypixels@@ -37,11 +37,9 @@ test-suite test     default-language:  Haskell2010     type:              exitcode-stdio-1.0-    main-is:           Spec.hs+    main-is:           Main.hs     hs-source-dirs:    test     ghc-options:       -Wall-    -- TODO: remove other-modules after stack can properly detect when to rebuild-    other-modules:     Spec      build-depends: base                  , friday
+ test/Main.hs view
@@ -0,0 +1,29 @@+{-# LANGUAGE TemplateHaskell #-}++import Test.Hspec++import Codec.Picture as JP+import qualified Data.ByteString+import Data.FileEmbed++import Vision.Image.JuicyPixels++rgba8Png :: Data.ByteString.ByteString+rgba8Png = $(embedFile "test/rgba8.png")++main :: IO ()+main = hspec spec++spec :: Spec+spec = do+  describe "RGBA conversion" $ do+    it "should not modify the image when converting from Juicy to Friday and back" $+        let result = decodeImage rgba8Png in case result of+            Right (ImageRGBA8 img) ->+                let fridayImg    = toFridayRGBA img+                    juicyImg     = toJuicyRGBA fridayImg+                    orig         = encodeDynamicPng $ ImageRGBA8 img+                    converted    = encodeDynamicPng $ ImageRGBA8 juicyImg+                in  orig `shouldBe` converted+            Left _ -> error "Image decoding error"+            _      -> error "Unexpected color space"
− test/Spec.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}--import Test.Hspec--import Codec.Picture as JP-import qualified Data.ByteString-import Data.FileEmbed--import Vision.Image.JuicyPixels---rgba8Png :: Data.ByteString.ByteString-rgba8Png = $(embedFile "test/rgba8.png")---main :: IO ()-main = hspec spec--spec :: Spec-spec = do-  describe "RGBA conversion" $ do-    it "should not modify the image when converting from Juicy to Friday and back" $-        let result = decodeImage rgba8Png in case result of-            Right (ImageRGBA8 img) ->-                let fridayImg    = toFridayRGBA img-                    juicyImg     = toJuicyRGBA fridayImg-                    orig         = encodeDynamicPng $ ImageRGBA8 img-                    converted    = encodeDynamicPng $ ImageRGBA8 juicyImg-                in  orig `shouldBe` converted-            Left _ -> error "Image decoding error"-            _      -> error "Unexpected color space"