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

currycheck extended to support non-parameterized tests in PAKCS

parent 2e27410a
......@@ -195,19 +195,20 @@ genMainFunction vm testModule tests =
publicModuleName :: String -> String
publicModuleName = (++ "_PUBLIC")
-- Check if a function is a property or not,
-- Check if a function definition is a property that should be tested,
-- i.e., if the result type is Prop (= [Test]) or PropIO.
-- Since Prop tests are supported by kics2 only, we add these only if
-- kics2 is used.
-- Since parameterized Prop tests are supported only by kics2,
-- we add these only if kics2 is used.
isTest :: CFuncDecl -> Bool
isTest = isTestType . funcType
where
isTestType :: CTypeExpr -> Bool
isTestType ct =
isPropIOType ct ||
(curryCompiler == "kics2" &&
resultType ct == listType (baseType (easyCheckModule, "Test")))
isPropIOType ct || ct == propType ||
(curryCompiler == "kics2" && resultType ct == propType)
propType = listType (baseType (easyCheckModule, "Test"))
isPropIOType :: CTypeExpr -> Bool
isPropIOType texp = case texp of
CTCons tcons [] -> tcons == (easyCheckModule,"PropIO")
......
......@@ -16,7 +16,8 @@ not_True = not True -=- False
not_False = not False -=- True
-- However, we can also use EasyCheck to guess input values to check
-- parameterized properties:
-- parameterized properties (currently, checking of parameterized properties
-- is only supported by KiCS2, therefore, such tests are ignored in PAKCS):
not_not_is_id b = not (not b) -=- b
-- In the former test, EasyCheck makes an exhaustive test by enumerating
......
Supports Markdown
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