Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-tools
Commits
cab3040d
Commit
cab3040d
authored
Feb 01, 2016
by
Michael Hanus
Browse files
currycheck extended to support non-parameterized tests in PAKCS
parent
2e27410a
Changes
2
Hide whitespace changes
Inline
Side-by-side
currycheck/CurryCheck.curry
View file @
cab3040d
...
...
@@ -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")
...
...
currycheck/Examples/ExampleTests.curry
View file @
cab3040d
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment