Skip to content

Commit

Permalink
THRIFT-1598 Update Haskell generated code to use Text, Hash{Map,Set},…
Browse files Browse the repository at this point in the history
… Vector

fix test suite

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1340044 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bufferoverflow committed May 18, 2012
1 parent 6849f20 commit da74ff4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion test/hs/DebugProtoTest_Main.hs 100644 → 100755
Expand Up @@ -17,6 +17,8 @@
-- under the License.
--

{-# LANGUAGE OverloadedStrings #-}

module Main where


Expand Down Expand Up @@ -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,
Expand Down
14 changes: 9 additions & 5 deletions test/hs/ThriftTest_Main.hs 100644 → 100755
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion test/hs/run-test.sh
Expand Up @@ -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

0 comments on commit da74ff4

Please sign in to comment.