@@ -23,6 +23,11 @@ import Data.Int
23import qualified Data.Map as Map
23import qualified Data.Map as Map
26+roundTripCaml :: String -> Bool
27+roundTripCaml s = s == (camlFrom '_' $ camlTo '_' s)
29+ camlFrom :: Char -> String -> String
30+ camlFrom c = concatMap capitalize $ split c
27encodeDouble :: Double -> Double -> Bool
32encodeDouble :: Double -> Double -> Bool
28encodeDouble num denom
33encodeDouble num denom
@@ -102,6 +107,10 @@ tests = [
102 testProperty "encodeDouble" encodeDouble
107 testProperty "encodeDouble" encodeDouble
103 , testProperty "encodeInteger" encodeInteger
108 , testProperty "encodeInteger" encodeInteger
110+ testGroup "camlCase" [
111+ testProperty "camlTo" $ roundTripCaml "AnApiMethod"
112+ , testProperty "camlTo" $ roundTripCaml "anotherMethodType"
105 testGroup "roundTrip" [
114 testGroup "roundTrip" [
106 testProperty "Bool" $ roundTripEq True
115 testProperty "Bool" $ roundTripEq True
107 , testProperty "Double" $ roundTripEq (1 :: Approx Double)
116 , testProperty "Double" $ roundTripEq (1 :: Approx Double)