You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2011/06/21 06:42:43 UTC
svn commit: r1137858 - in /thrift/trunk/test/hs: ./ ThriftTest_Main.hs
Author: roger
Date: Tue Jun 21 04:42:43 2011
New Revision: 1137858
URL: http://svn.apache.org/viewvc?rev=1137858&view=rev
Log:
THRIFT-1202 Malformed JSON for map<string,type> services parameters
fix broken build (add testcase to haskell test suite)
Modified:
thrift/trunk/test/hs/ (props changed)
thrift/trunk/test/hs/ThriftTest_Main.hs
Propchange: thrift/trunk/test/hs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jun 21 04:42:43 2011
@@ -1,2 +1,3 @@
+gen-*
Makefile
Makefile.in
Modified: thrift/trunk/test/hs/ThriftTest_Main.hs
URL: http://svn.apache.org/viewvc/thrift/trunk/test/hs/ThriftTest_Main.hs?rev=1137858&r1=1137857&r2=1137858&view=diff
==============================================================================
--- thrift/trunk/test/hs/ThriftTest_Main.hs (original)
+++ thrift/trunk/test/hs/ThriftTest_Main.hs Tue Jun 21 04:42:43 2011
@@ -99,6 +99,13 @@ instance Iface.ThriftTest_Iface TestHand
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