mirror of
https://github.com/ilyakooo0/streamly.git
synced 2024-09-11 08:25:40 +03:00
Print more information in failing tests
This commit is contained in:
parent
c30184d2da
commit
7e9f2a5a5c
@ -19,6 +19,8 @@ import Test.QuickCheck.Monadic (monadicIO, assert, run)
|
||||
import Test.Hspec as H
|
||||
|
||||
import Streamly.Prelude (SerialT)
|
||||
import Streamly.Test.Common (listEquals)
|
||||
|
||||
import qualified Streamly.Prelude as S
|
||||
#ifdef TEST_SMALL_ARRAY
|
||||
import qualified Streamly.Internal.Data.SmallArray as A
|
||||
@ -131,7 +133,7 @@ testFromListN =
|
||||
monadicIO $ do
|
||||
let arr = A.fromListN n list
|
||||
xs <- run $ S.toList $ (S.unfold A.read) arr
|
||||
assert (xs == take n list)
|
||||
listEquals (==) xs (take n list)
|
||||
|
||||
#ifndef TEST_SMALL_ARRAY
|
||||
testFromStreamToStream :: Property
|
||||
|
@ -42,6 +42,8 @@ listEquals eq stream list = do
|
||||
when (not $ stream `eq` list) $ liftIO $ putStrLn $
|
||||
"stream " <> show stream
|
||||
<> "\nlist " <> show list
|
||||
<> "\nstream length " <> show (length stream)
|
||||
<> "\nlist length " <> show (length list)
|
||||
<> "\nstream \\\\ list " <> show (stream \\ list)
|
||||
<> "\nlist \\\\ stream " <> show (list \\ stream)
|
||||
when (not $ stream `eq` list) $
|
||||
@ -49,6 +51,8 @@ listEquals eq stream list = do
|
||||
(counterexample $
|
||||
"stream " <> show stream
|
||||
<> "\nlist " <> show list
|
||||
<> "\nstream length " <> show (length stream)
|
||||
<> "\nlist length " <> show (length list)
|
||||
<> "\nstream \\\\ list " <> show (stream \\ list)
|
||||
<> "\nlist \\\\ stream " <> show (list \\ stream)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user