@@ -26,9 +26,12 @@ import qualified Streamly.Prelude as S
2626import qualified Streamly.Internal.Data.SmallArray as A
2727type Array = A.SmallArray
2828#elif defined(TEST_ARRAY)
29+import Data.Word(Word8)
30+
2931import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
3032import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
3133import qualified Streamly.Internal.Data.Stream.IsStream as IP
34+import qualified Streamly.Internal.Memory.ArrayStream as AS
3235type Array = A.Array
3336#elif defined(DATA_ARRAY_PRIM_PINNED)
3437import qualified Streamly.Internal.Data.Array.Prim.Pinned as A
@@ -173,6 +176,17 @@ testLastN_LN len n = do
173176 l1 <- fmap A.toList $ S.fold (A.lastN n) $ S.fromList list
174177 let l2 = lastN n list
175178 return $ l1 == l2
179+
180+-- Instead of hard coding 10000 here we can have maxStreamLength for operations
181+-- that use stream of arrays.
182+concatArrayW8 :: Property
183+concatArrayW8 =
184+ forAll (vectorOf 10000 (arbitrary :: Gen Word8))
185+ $ \w8List -> do
186+ let w8ArrList = A.fromList . (: []) <$> w8List
187+ f2 <- S.toList $ AS.concat $ S.fromList w8ArrList
188+ w8List `shouldBe` f2
189+
176190#endif
177191
178192main :: IO ()
@@ -201,6 +215,7 @@ main =
201215#endif
202216
203217#ifdef TEST_ARRAY
218+ prop "AS.concat . (A.fromList . (:[]) <$>) === id" $ concatArrayW8
204219 describe "Fold" $ do
205220 prop "lastN : 0 <= n <= len" $ testLastN
206221 describe "lastN boundary conditions" $ do