regexchar-0.9.0.8: src/Grecce/Test/QC/QuickChecks.hs
{-# LANGUAGE CPP #-}
{-
Copyright (C) 2010 Dr. Alistair Ward
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-}
{- |
[@AUTHOR@] Dr. Alistair Ward
[@DESCRIPTION@] Calls the /quickChecks/-functions for modules supporting this feature.
-}
module Grecce.Test.QC.QuickChecks(
-- * Functions
run
) where
import qualified Grecce.Test.QC.ExtendedRegExChar as Test.QC.ExtendedRegExChar
import qualified Grecce.Test.QC.MetaChar as Test.QC.MetaChar
import qualified Grecce.Test.QC.RepeatableMetaChar as Test.QC.RepeatableMetaChar
import qualified Test.QuickCheck
{- | Run the /quickChecks/-functions for modules supporting this feature.
The single Boolean flag enables verbose output.
-}
run :: Bool -> IO ()
run isVerbose =
putStrLn "MetaChar" >> Test.QC.MetaChar.quickChecks checker
>> putStrLn "RepeatableMetaChar" >> Test.QC.RepeatableMetaChar.quickChecks checker
>> putStrLn "ExtendedRegExChar" >> Test.QC.ExtendedRegExChar.quickChecks checker
where
checker :: Test.QuickCheck.Testable t => t -> IO ()
checker
| isVerbose =
#if MIN_VERSION_QuickCheck(2,4,0)
Test.QuickCheck.verboseCheck
#else
error "Grecce.Test.QC.QuickChecks:\t'Test.QuickCheck.verboseCheck' is only available as of 'QuickCheck-2.4'."
#endif
| otherwise = Test.QuickCheck.quickCheck