Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

THRIFT-1598 Update Haskell generated code to use Text, Hash{Map,Set},…

… Vector

fix test suite

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1340044 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit da74ff4a3be2bf3709549852d3c9f30737b3e93d 1 parent 6849f20
@bufferoverflow bufferoverflow authored
View
4 test/hs/DebugProtoTest_Main.hs 100644 → 100755
@@ -17,6 +17,8 @@
-- under the License.
--
+{-# LANGUAGE OverloadedStrings #-}
+
module Main where
@@ -78,7 +80,7 @@ instance SIface.Srv_Iface InheritedHandler where
Types.f_CompactProtoTestStruct_string_list = Nothing,
Types.f_CompactProtoTestStruct_binary_list = Nothing,
Types.f_CompactProtoTestStruct_boolean_list = Nothing,
- Types.f_CompactProtoTestStruct_struct_list = Just [Types.Empty],
+ Types.f_CompactProtoTestStruct_struct_list = Nothing,
Types.f_CompactProtoTestStruct_byte_set = Nothing,
Types.f_CompactProtoTestStruct_i16_set = Nothing,
View
14 test/hs/ThriftTest_Main.hs 100644 → 100755
@@ -18,12 +18,16 @@
-- under the License.
--
+{-# LANGUAGE OverloadedStrings #-}
+
module Main where
import qualified Control.Exception
-import qualified Data.Map as Map
-import qualified Data.Set as Set
+import qualified Data.HashMap.Strict as Map
+import qualified Data.HashSet as Set
+import qualified Data.Vector as Vector
+
import qualified Network
import Thrift
@@ -44,7 +48,7 @@ instance Iface.ThriftTest_Iface TestHandler where
testVoid _ = return ()
testString _ (Just s) = do
- ThriftTestUtils.serverLog s
+ ThriftTestUtils.serverLog $ show s
return s
testString _ Nothing = do
@@ -168,7 +172,7 @@ client addr = do
let ps = (BinaryProtocol to, BinaryProtocol to)
v1 <- Client.testString ps "bya"
- ThriftTestUtils.clientLog v1
+ ThriftTestUtils.clientLog $ show v1
v2 <- Client.testByte ps 8
ThriftTestUtils.clientLog $ show v2
@@ -200,7 +204,7 @@ client addr = do
v11 <- Client.testStringMap ps (Map.fromList [("a","123"),("a b","with spaces "),("same","same"),("0","numeric key")])
ThriftTestUtils.clientLog $ show v11
- v12 <- Client.testList ps [1,2,3,4,5]
+ v12 <- Client.testList ps (Vector.fromList [1,2,3,4,5])
ThriftTestUtils.clientLog $ show v12
v13 <- Client.testSet ps (Set.fromList [1,2,3,4,5])
View
2  test/hs/run-test.sh
@@ -68,4 +68,4 @@ printf "Generating bindings... \n"
$THRIFT_BIN --gen hs $THRIFT_FILE
printf "Running test... \n"
-runhaskell -Wall -Werror -i$BASE/lib/hs/src -igen-hs $TEST_SOURCE_FILE
+runhaskell -Wall -i$BASE/lib/hs/src -igen-hs $TEST_SOURCE_FILE
Please sign in to comment.
Something went wrong with that request. Please try again.