diff --git a/json-rpc-server.cabal b/json-rpc-server.cabal index d512639..8906c15 100644 --- a/json-rpc-server.cabal +++ b/json-rpc-server.cabal @@ -2,14 +2,13 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: json-rpc-server -version: 0.1.5.0 +version: 0.1.6.0 license: MIT license-file: LICENSE category: Network, JSON maintainer: Kristen Kozak synopsis: JSON-RPC 2.0 on the server side. build-type: Simple -extra-source-files: README.md cabal-version: >=1.8 tested-with: GHC == 7.0.1, GHC == 7.4.1, GHC == 7.6.2, GHC == 7.6.3, GHC == 7.8.3, GHC == 7.10.1 @@ -36,7 +35,7 @@ library exposed-modules: Network.JsonRpc.Server other-modules: Network.JsonRpc.Types build-depends: base >=4.3 && <4.9, - aeson >=0.6 && <0.9, + aeson >=0.6 && <0.10, deepseq >= 1.1 && <1.5, bytestring >=0.9 && <0.11, mtl >=1.1.1 && <2.3, @@ -67,7 +66,7 @@ test-suite tests HUnit >=1.2 && <1.3, test-framework >=0.7 && <0.9, test-framework-hunit >=0.3 && <0.4, - aeson >=0.6 && <0.9, + aeson >=0.6 && <0.10, bytestring >=0.9 && <0.11, mtl >=1.1.1 && <2.3, text >=0.11 && <1.3, diff --git a/tests/TestSuite.hs b/tests/TestSuite.hs index e176794..5fb2c00 100644 --- a/tests/TestSuite.hs +++ b/tests/TestSuite.hs @@ -17,6 +17,7 @@ import qualified Data.Aeson as A import Data.Aeson ((.=)) import qualified Data.Aeson.Types as A import qualified Data.HashMap.Strict as H +import qualified Data.ByteString.Lazy.Char8 as LB import Control.Monad.Trans (liftIO) import Control.Monad.State (State, runState, lift, modify) import Control.Monad.Identity (Identity, runIdentity) @@ -34,7 +35,8 @@ main = defaultMain $ errorHandlingTests ++ otherTests errorHandlingTests :: [Test] errorHandlingTests = [ testCase "invalid JSON" $ - assertSubtractResponse (A.String "5") $ nullIdErrRsp (-32700) + let rsp = runIdentity $ S.call (S.toMethods []) $ LB.pack "{" + in removeErrMsg <$> (A.decode =<< rsp) @?= Just (nullIdErrRsp (-32700)) , testCase "invalid JSON-RPC" $ assertSubtractResponse (A.object ["id" .= A.Number 10]) $ nullIdErrRsp (-32600)