Skip to content

Commit

Permalink
Remove non-ASCII character from messages from test suite.
Browse files Browse the repository at this point in the history
They prevent tests from running on machines with locales
where they couldn't be printed.

(Reported at haskell#42)
  • Loading branch information
Shimuuar committed Nov 28, 2012
1 parent 3926e8a commit 70cd06d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/Tests/Distribution.hs
Expand Up @@ -88,10 +88,10 @@ discreteDistrTests t = testGroup ("Tests for: " ++ typeName t) $
cdfTests :: (Param d, Distribution d, QC.Arbitrary d, Show d) => T d -> [Test]
cdfTests t =
[ testProperty "C.D.F. sanity" $ cdfSanityCheck t
, testProperty "CDF limit at +" $ cdfLimitAtPosInfinity t
, testProperty "CDF limit at -" $ cdfLimitAtNegInfinity t
, testProperty "CDF at + = 1" $ cdfAtPosInfinity t
, testProperty "CDF at - = 1" $ cdfAtNegInfinity t
, testProperty "CDF limit at +inf" $ cdfLimitAtPosInfinity t
, testProperty "CDF limit at -inf" $ cdfLimitAtNegInfinity t
, testProperty "CDF at +inf = 1" $ cdfAtPosInfinity t
, testProperty "CDF at -inf = 1" $ cdfAtNegInfinity t
, testProperty "CDF is nondecreasing" $ cdfIsNondecreasing t
, testProperty "1-CDF is correct" $ cdfComplementIsCorrect t
]
Expand Down Expand Up @@ -174,9 +174,9 @@ probSanityCheck _ d x = p >= 0 && p <= 1
-- Check that discrete CDF is correct
discreteCDFcorrect :: (DiscreteDistr d) => T d -> d -> Int -> Int -> Property
discreteCDFcorrect _ d a b
= printTestCase (printf "CDF = %g" p1)
$ printTestCase (printf "Sum = %g" p2)
$ printTestCase (printf "Δ = %g" (abs (p1 - p2)))
= printTestCase (printf "CDF = %g" p1)
$ printTestCase (printf "Sum = %g" p2)
$ printTestCase (printf "Delta = %g" (abs (p1 - p2)))
$ abs (p1 - p2) < 3e-10
-- Avoid too large differeneces. Otherwise there is to much to sum
--
Expand Down Expand Up @@ -280,17 +280,17 @@ unitTests = testGroup "Unit tests"
where
-- Student-T
testStudentPDF ndf x exact
= testAssertion (printf "density (studentT %f) %f %f" ndf x exact)
= testAssertion (printf "density (studentT %f) %f ~ %f" ndf x exact)
$ eq 1e-5 exact (density (studentT ndf) x)
testStudentCDF ndf x exact
= testAssertion (printf "cumulative (studentT %f) %f %f" ndf x exact)
= testAssertion (printf "cumulative (studentT %f) %f ~ %f" ndf x exact)
$ eq 1e-5 exact (cumulative (studentT ndf) x)
-- F-distribution
testFdistrPDF n m x exact
= testAssertion (printf "density (fDistribution %i %i) %f %f [got %f]" n m x exact d)
= testAssertion (printf "density (fDistribution %i %i) %f ~ %f [got %f]" n m x exact d)
$ eq 1e-5 exact d
where d = density (fDistribution n m) x
testFdistrCDF n m x exact
= testAssertion (printf "cumulative (fDistribution %i %i) %f %f [got %f]" n m x exact d)
= testAssertion (printf "cumulative (fDistribution %i %i) %f ~ %f [got %f]" n m x exact d)
$ eq 1e-5 exact d
where d = cumulative (fDistribution n m) x

0 comments on commit 70cd06d

Please sign in to comment.