octane 0.1.0 → 0.1.1
raw patch · 6 files changed
+33/−7 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Octane.Types.Int32LE: instance GHC.Classes.Eq Octane.Types.Int32LE.Int32LE
+ Octane.Types.Int64LE: instance GHC.Classes.Eq Octane.Types.Int64LE.Int64LE
Files
- library/Octane/Types/Int32LE.hs +1/−1
- library/Octane/Types/Int64LE.hs +1/−1
- octane.cabal +1/−1
- test-suite/Octane/Types/BooleanSpec.hs +0/−2
- test-suite/Octane/Types/Int32LESpec.hs +15/−1
- test-suite/Octane/Types/Int64LESpec.hs +15/−1
library/Octane/Types/Int32LE.hs view
@@ -4,7 +4,7 @@ newtype Int32LE = NewInt32LE { getInt32LE :: Int32- } deriving (Show)+ } deriving (Eq, Show) instance Binary Int32LE where get = do
library/Octane/Types/Int64LE.hs view
@@ -4,7 +4,7 @@ newtype Int64LE = NewInt64LE { getInt64LE :: Int64- } deriving (Show)+ } deriving (Eq, Show) instance Binary Int64LE where get = do
octane.cabal view
@@ -1,5 +1,5 @@ name: octane-version: 0.1.0+version: 0.1.1 cabal-version: >=1.10 build-type: Simple license: MIT
test-suite/Octane/Types/BooleanSpec.hs view
@@ -16,8 +16,6 @@ it "can be encoded" $ do Binary.encode (Octane.NewBoolean False) `shouldBe` "\0" Binary.encode (Octane.NewBoolean True) `shouldBe` "\1"- it "handles extra data when decoding" $ do- decodeBoolean "\0extra" `shouldBe` Right ("extra", 1, Octane.NewBoolean False) it "does not raise a runtime error when decoding garbage" $ do decodeBoolean "garbage" `shouldBe` Left ("arbage", 1, "out of bounds")
test-suite/Octane/Types/Int32LESpec.hs view
@@ -1,7 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}+ module Octane.Types.Int32LESpec (spec) where +import qualified Data.Binary as Binary+import qualified Data.Binary.Get as Binary+import qualified Data.ByteString.Lazy as BSL+import qualified Octane as Octane import Test.Tasty.Hspec spec :: Spec spec = describe "Int32LE" $ do- return ()+ it "can be decoded" $ do+ decodeInt32LE "\0\0\0\0" `shouldBe` Right ("", 4, Octane.NewInt32LE 0)+ decodeInt32LE "\1\0\0\0" `shouldBe` Right ("", 4, Octane.NewInt32LE 1)+ it "can be encoded" $ do+ Binary.encode (Octane.NewInt32LE 0) `shouldBe` "\0\0\0\0"+ Binary.encode (Octane.NewInt32LE 1) `shouldBe` "\1\0\0\0"++decodeInt32LE :: BSL.ByteString -> Either (BSL.ByteString, Binary.ByteOffset, String) (BSL.ByteString, Binary.ByteOffset, Octane.Int32LE)+decodeInt32LE = Binary.decodeOrFail
test-suite/Octane/Types/Int64LESpec.hs view
@@ -1,7 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}+ module Octane.Types.Int64LESpec (spec) where +import qualified Data.Binary as Binary+import qualified Data.Binary.Get as Binary+import qualified Data.ByteString.Lazy as BSL+import qualified Octane as Octane import Test.Tasty.Hspec spec :: Spec spec = describe "Int64LE" $ do- return ()+ it "can be decoded" $ do+ decodeInt64LE "\0\0\0\0\0\0\0\0" `shouldBe` Right ("", 8, Octane.NewInt64LE 0)+ decodeInt64LE "\1\0\0\0\0\0\0\0" `shouldBe` Right ("", 8, Octane.NewInt64LE 1)+ it "can be encoded" $ do+ Binary.encode (Octane.NewInt64LE 0) `shouldBe` "\0\0\0\0\0\0\0\0"+ Binary.encode (Octane.NewInt64LE 1) `shouldBe` "\1\0\0\0\0\0\0\0"++decodeInt64LE :: BSL.ByteString -> Either (BSL.ByteString, Binary.ByteOffset, String) (BSL.ByteString, Binary.ByteOffset, Octane.Int64LE)+decodeInt64LE = Binary.decodeOrFail