Commits

Anonymous committed f142418

Adding tests for the camlCase operation.

  • Participants
  • Parent commits efd7f8f

Comments (0)

Files changed (1)

File tests/Properties.hs

 import qualified Data.Map as Map
 #endif
 
+roundTripCaml :: String -> Bool
+roundTripCaml s = s == (camlFrom '_' $ camlTo '_' s)
+  where
+    camlFrom :: Char -> String -> String
+    camlFrom c = concatMap capitalize $ split c
 
 encodeDouble :: Double -> Double -> Bool
 encodeDouble num denom
       testProperty "encodeDouble" encodeDouble
     , testProperty "encodeInteger" encodeInteger
     ],
+  testGroup "camlCase" [
+      testProperty "camlTo" $ roundTripCaml "AnApiMethod"
+    , testProperty "camlTo" $ roundTripCaml "anotherMethodType"
+    ],
   testGroup "roundTrip" [
       testProperty "Bool" $ roundTripEq True
     , testProperty "Double" $ roundTripEq (1 :: Approx Double)