From 2603ebfbe9cc20c413998b67e9805259b012994f Mon Sep 17 00:00:00 2001 From: Michael Hanus Date: Wed, 2 Jan 2019 11:54:16 +0100 Subject: [PATCH] Changes w.r.t. new module Test.Prop.Types --- src/CurryCheck.curry | 2 +- src/PropertyUsage.curry | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/CurryCheck.curry b/src/CurryCheck.curry index 889a03f..53b525b 100644 --- a/src/CurryCheck.curry +++ b/src/CurryCheck.curry @@ -607,7 +607,7 @@ funDeclsWith pred = filter (pred . snd . funcName) propResultType :: CTypeExpr -> CTypeExpr propResultType te = case te of CFuncType from to -> CFuncType from (propResultType to) - _ -> baseType (easyCheckModule,"Prop") + _ -> baseType (propTypesModule,"Prop") -- Transforms a function declaration into a post condition test if -- there is a post condition for this function (i.e., a relation named diff --git a/src/PropertyUsage.curry b/src/PropertyUsage.curry index 178c754..4603aa1 100644 --- a/src/PropertyUsage.curry +++ b/src/PropertyUsage.curry @@ -3,12 +3,12 @@ --- a Curry program. --- --- @author Michael Hanus ---- @version December 2017 +--- @version January 2019 ------------------------------------------------------------------------ module PropertyUsage ( isProperty, isPropType, isPropIOType, isEquivProperty - , propModule, easyCheckModule, easyCheckExecModule + , propModule, propTypesModule, easyCheckModule, easyCheckExecModule ) where import AbstractCurry.Types @@ -25,13 +25,13 @@ isProperty = isPropertyType . typeOfQualType . funcType --- Is the type expression the type Test.EasyCheck.Prop? isPropType :: CTypeExpr -> Bool isPropType texp = case texp of - CTCons (mn,tc) -> tc == "Prop" && isCheckModule mn + CTCons (mn,tc) -> tc == "Prop" && mn == propTypesModule _ -> False --- Is the type expression the type Test.EasyCheck.PropIO? isPropIOType :: CTypeExpr -> Bool isPropIOType texp = case texp of - CTCons (mn,tc) -> tc == "PropIO" && isCheckModule mn + CTCons (mn,tc) -> tc == "PropIO" && mn == propTypesModule _ -> False --- Check whether a function definition is an equivalence property, i.e., @@ -54,6 +54,10 @@ isCheckModule mn = mn == propModule || mn == easyCheckModule propModule :: String propModule = "Test.Prop" +--- Name of the Test.Prop.Types module (containing property type definitions). +propTypesModule :: String +propTypesModule = "Test.Prop.Types" + --- Name of the EasyCheck module. easyCheckModule :: String easyCheckModule = "Test.EasyCheck" -- GitLab