Commit d92889bf authored by Michael Hanus 's avatar Michael Hanus

kics2 check: extended to generate floats

parent ae8cee50
......@@ -295,15 +295,15 @@ createTests opts mainmodname tm = map createTest (propTests tm)
(applyF (easyCheckExecModule, "checkPropWithMsg")
[CVar msgvar
,applyF (easyCheckFuncName (length argtypes)) $
[configOpWithMaxFail, CVar msgvar] ++
(map (\t ->
applyF (easyCheckModule,"valuesOfSearchTree")
[if isPAKCS || useUserDefinedGen t
then type2genop mainmodname tm t
else applyF (searchTreeModule,"someSearchTree")
[constF (pre "unknown")]])
argtypes) ++
[CSymbol (testmname,name)]
[configOpWithMaxFail, CVar msgvar] ++
(map (\t ->
applyF (easyCheckModule,"valuesOfSearchTree")
[if isPAKCS || useUserDefinedGen t || isFloatType t
then type2genop mainmodname tm t
else applyF (searchTreeModule,"someSearchTree")
[constF (pre "unknown")]])
argtypes) ++
[CSymbol (testmname,name)]
])]
where
useUserDefinedGen texp = case texp of
......@@ -348,6 +348,10 @@ type2genop mainmod tm (CTCons qt targs) =
applyF (typename2genopname mainmod (generators tm) qt)
(map (type2genop mainmod tm) targs)
isFloatType :: CTypeExpr -> Bool
isFloatType texp = case texp of CTCons tc [] -> tc == (preludeName,"Float")
_ -> False
typename2genopname :: String -> [QName] -> QName -> QName
typename2genopname mainmod definedgenops (mn,tc)
| isJust maybeuserdefined -- take user-defined generator:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment