packages feed

regexchar-0.9.0.7: src/Grecce/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.QC.QuickChecks(
-- * Functions
	run
) where

import qualified	Grecce.QC.ExtendedRegExChar	as QC.ExtendedRegExChar
import qualified	Grecce.QC.MetaChar		as QC.MetaChar
import qualified	Grecce.QC.RepeatableMetaChar	as 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"			>> QC.MetaChar.quickChecks checker
	>> putStrLn "RepeatableMetaChar"	>> QC.RepeatableMetaChar.quickChecks checker
	>> putStrLn "ExtendedRegExChar"		>> 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.QC.QuickChecks:\t'Test.QuickCheck.verboseCheck' is only available as of 'QuickCheck-2.4'."
#endif
			| otherwise	= Test.QuickCheck.quickCheck