Commit d92889bf authored by Michael Hanus 's avatar Michael Hanus
Browse files

kics2 check: extended to generate floats

parent ae8cee50
...@@ -295,15 +295,15 @@ createTests opts mainmodname tm = map createTest (propTests tm) ...@@ -295,15 +295,15 @@ createTests opts mainmodname tm = map createTest (propTests tm)
(applyF (easyCheckExecModule, "checkPropWithMsg") (applyF (easyCheckExecModule, "checkPropWithMsg")
[CVar msgvar [CVar msgvar
,applyF (easyCheckFuncName (length argtypes)) $ ,applyF (easyCheckFuncName (length argtypes)) $
[configOpWithMaxFail, CVar msgvar] ++ [configOpWithMaxFail, CVar msgvar] ++
(map (\t -> (map (\t ->
applyF (easyCheckModule,"valuesOfSearchTree") applyF (easyCheckModule,"valuesOfSearchTree")
[if isPAKCS || useUserDefinedGen t [if isPAKCS || useUserDefinedGen t || isFloatType t
then type2genop mainmodname tm t then type2genop mainmodname tm t
else applyF (searchTreeModule,"someSearchTree") else applyF (searchTreeModule,"someSearchTree")
[constF (pre "unknown")]]) [constF (pre "unknown")]])
argtypes) ++ argtypes) ++
[CSymbol (testmname,name)] [CSymbol (testmname,name)]
])] ])]
where where
useUserDefinedGen texp = case texp of useUserDefinedGen texp = case texp of
...@@ -348,6 +348,10 @@ type2genop mainmod tm (CTCons qt targs) = ...@@ -348,6 +348,10 @@ type2genop mainmod tm (CTCons qt targs) =
applyF (typename2genopname mainmod (generators tm) qt) applyF (typename2genopname mainmod (generators tm) qt)
(map (type2genop mainmod tm) targs) (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 :: String -> [QName] -> QName -> QName
typename2genopname mainmod definedgenops (mn,tc) typename2genopname mainmod definedgenops (mn,tc)
| isJust maybeuserdefined -- take user-defined generator: | 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