diff options
author | Kamil Dworakowski <kamil@dworakowski.name> | 2018-03-29 21:22:58 +0200 |
---|---|---|
committer | Kamil Dworakowski <kamil@dworakowski.name> | 2018-03-29 21:23:35 +0200 |
commit | 1bdd94324c6e7cd9d9361c4136998d4c14ea3857 (patch) | |
tree | 387fa72e213537c654cd32c7473d96c1fb96f581 /packages/tests/src/Numeric/LinearAlgebra | |
parent | d83b17190029c11e3ab8b504e5cdc917f5863120 (diff) |
improve test failures description
Diffstat (limited to 'packages/tests/src/Numeric/LinearAlgebra')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs index 2aefc87..c146e93 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs | |||
@@ -514,7 +514,7 @@ indexProp g f x = a1 == g a2 && a2 == a3 && b1 == g b2 && b2 == b3 | |||
514 | 514 | ||
515 | -------------------------------------------------------------------------------- | 515 | -------------------------------------------------------------------------------- |
516 | 516 | ||
517 | sliceTest = utest "slice test" $ and | 517 | sliceTest = TestLabel "slice test" . TestList $ |
518 | [ testSlice (chol . trustSym) (gen 5 :: Matrix R) | 518 | [ testSlice (chol . trustSym) (gen 5 :: Matrix R) |
519 | , testSlice (chol . trustSym) (gen 5 :: Matrix C) | 519 | , testSlice (chol . trustSym) (gen 5 :: Matrix C) |
520 | , testSlice qr (rec :: Matrix R) | 520 | , testSlice qr (rec :: Matrix R) |
@@ -617,7 +617,7 @@ sliceTest = utest "slice test" $ and | |||
617 | 617 | ||
618 | test_qrgr n t x = qrgr n (QR x t) | 618 | test_qrgr n t x = qrgr n (QR x t) |
619 | 619 | ||
620 | ok_qrgr x = simeq 1E-15 q q' | 620 | ok_qrgr x = TestCase . assertBool "ok_qrgr" $ simeq 1E-15 q q' |
621 | where | 621 | where |
622 | (q,_) = qr x | 622 | (q,_) = qr x |
623 | atau = qrRaw x | 623 | atau = qrRaw x |
@@ -646,7 +646,8 @@ sliceTest = utest "slice test" $ and | |||
646 | rec :: Numeric t => Matrix t | 646 | rec :: Numeric t => Matrix t |
647 | rec = subMatrix (0,0) (4,5) (gen 5) | 647 | rec = subMatrix (0,0) (4,5) (gen 5) |
648 | 648 | ||
649 | testSlice f x@(size->sz@(r,c)) = all (==f x) (map f (g y1 ++ g y2)) | 649 | testSlice f x@(size->sz@(r,c)) = |
650 | TestList . map (TestCase . assertEqual "" (f x)) $ (map f (g y1 ++ g y2)) | ||
650 | where | 651 | where |
651 | subm = subMatrix | 652 | subm = subMatrix |
652 | g y = [ subm (a*r,b*c) sz y | a <-[0..2], b <- [0..2]] | 653 | g y = [ subm (a*r,b*c) sz y | a <-[0..2], b <- [0..2]] |