ideas-math-1.2: src/Domain/Math/SquareRoot/Tests.hs
-----------------------------------------------------------------------------
-- Copyright 2015, Open Universiteit Nederland. This file is distributed
-- under the terms of the GNU General Public License. For more information,
-- see the file "LICENSE.txt", which is included in the distribution.
-----------------------------------------------------------------------------
-- |
-- Maintainer : bastiaan.heeren@ou.nl
-- Stability : provisional
-- Portability : portable (depends on ghc)
--
-----------------------------------------------------------------------------
-- $Id: Tests.hs 7527 2015-04-08 07:58:06Z bastiaan $
module Domain.Math.SquareRoot.Tests (tests) where
import Domain.Math.Data.SquareRoot
import Ideas.Common.Algebra.Field
import Ideas.Common.Algebra.FieldLaws
import Ideas.Common.Algebra.GroupLaws
import Ideas.Common.Algebra.Law
import Ideas.Common.Utils.TestSuite
-------------------------------------------------------------------
-- Testing
tests :: TestSuite
tests = mconcat $ map f $
commutativeRingLaws ++
distributiveSubtractionLaws ++
map fromAdditiveLaw appendInverseLaws
where
f :: Law (SafeNum (SquareRoot Rational)) -> TestSuite
f p = useProperty (show p) p