From 0680a836344a4d3927131d26c1b38c2d7b379517 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Tue, 21 Jun 2011 04:42:43 +0000 Subject: [PATCH] THRIFT-1202 Malformed JSON for map services parameters fix broken build (add testcase to haskell test suite) git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1137858 13f79535-47bb-0310-9956-ffa450edef68 --- test/hs/ThriftTest_Main.hs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/hs/ThriftTest_Main.hs b/test/hs/ThriftTest_Main.hs index 4160c179..2f9fc4a8 100644 --- a/test/hs/ThriftTest_Main.hs +++ b/test/hs/ThriftTest_Main.hs @@ -99,6 +99,13 @@ instance Iface.ThriftTest_Iface TestHandler where testMap _ Nothing = do error $ "Unsupported testMap form" + testStringMap _ (Just x) = do + ThriftTestUtils.serverLog $ show x + return x + + testStringMap _ Nothing = do + error $ "Unsupported testMap form" + testSet _ (Just x) = do ThriftTestUtils.serverLog $ show x return x @@ -190,15 +197,18 @@ client addr = do v10 <- Client.testMap ps (Map.fromList [(1,1),(2,2),(3,3)]) ThriftTestUtils.clientLog $ show v10 - v11 <- Client.testList ps [1,2,3,4,5] + v11 <- Client.testStringMap ps (Map.fromList [("a","123"),("a b","with spaces "),("same","same"),("0","numeric key")]) ThriftTestUtils.clientLog $ show v11 - v12 <- Client.testSet ps (Set.fromList [1,2,3,4,5]) + v12 <- Client.testList ps [1,2,3,4,5] ThriftTestUtils.clientLog $ show v12 - v13 <- Client.testStruct ps (Types.Xtruct (Just "hi") (Just 4) (Just 5) Nothing) + v13 <- Client.testSet ps (Set.fromList [1,2,3,4,5]) ThriftTestUtils.clientLog $ show v13 + v14 <- Client.testStruct ps (Types.Xtruct (Just "hi") (Just 4) (Just 5) Nothing) + ThriftTestUtils.clientLog $ show v14 + (testException ps "bad") `Control.Exception.catch` testExceptionHandler (testMultiException ps "ok") `Control.Exception.catch` testMultiExceptionHandler1 -- 2.17.1