regexchar-0.9.0.12: src/Grecce/Test/QC/QuickChecks.hs
{-
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 Control.Arrow
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 = mapM_ (
uncurry (>>) . Control.Arrow.first putStrLn
) [
("MetaChar", Test.QC.MetaChar.quickChecks checker),
("RepeatableMetaChar", Test.QC.RepeatableMetaChar.quickChecks checker),
("ExtendedRegExChar", Test.QC.ExtendedRegExChar.quickChecks checker)
] where
checker :: Test.QuickCheck.Testable t => t -> IO ()
checker
| isVerbose = Test.QuickCheck.verboseCheck
| otherwise = Test.QuickCheck.quickCheck