File tree Expand file tree Collapse file tree 4 files changed +25
-69
lines changed
Expand file tree Collapse file tree 4 files changed +25
-69
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ extra-source-files:
101101 test/Streamly/Test/Data/Array/Prim/Pinned.hs
102102 test/Streamly/Test/Data/Array/Foreign.hs
103103 test/Streamly/Test/Data/Array/Stream/Foreign.hs
104- test/Streamly/Test/Data/Parser/ParserD.hs
105- test/Streamly/Test/Data/Stream/Top.hs
104+ test/Streamly/Test/Data/Parser/ParserD.hs
106105 test/Streamly/Test/FileSystem/Event.hs
107106 test/Streamly/Test/FileSystem/Event/Common.hs
108107 test/Streamly/Test/FileSystem/Event/Darwin.hs
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- module Main (main ) where
1+ module Main (main )
2+ where
23
3- import Data.List (sort )
4+ import Data.List (intersect , sort )
45import Test.QuickCheck
56 ( Gen
67 , Property
@@ -65,10 +66,26 @@ joinInnerMap =
6566 ]
6667 assert (v1 == v2)
6768
68- -------------------------------------------------------------------------------
69- -- Main
70- -------------------------------------------------------------------------------
69+ intersectBySorted :: Property
70+ intersectBySorted =
71+ forAll (listOf (chooseInt (min_value, max_value))) $ \ ls0 ->
72+ forAll (listOf (chooseInt (min_value, max_value))) $ \ ls1 ->
73+ monadicIO $ action (sort ls0) (sort ls1)
74+
75+ where
7176
77+ action ls0 ls1 = do
78+ v1 <-
79+ run
80+ $ S. toList
81+ $ Top. intersectBySorted
82+ compare
83+ (S. fromList ls0)
84+ (S. fromList ls1)
85+ let v2 = intersect ls0 ls1
86+ assert (v1 == sort v2)
87+
88+ -------------------------------------------------------------------------------
7289moduleName :: String
7390moduleName = " Prelude.Top"
7491
@@ -79,3 +96,5 @@ main = hspec $ do
7996
8097 prop " joinInner" Main. joinInner
8198 prop " joinInnerMap" Main. joinInnerMap
99+ -- intersect
100+ prop " intersectBySorted" Main. intersectBySorted
Original file line number Diff line number Diff line change @@ -434,8 +434,3 @@ test-suite version-bounds
434434 import : test-options
435435 type : exitcode-stdio-1.0
436436 main-is : version-bounds.hs
437-
438- test-suite Data.Stream.Top
439- import : test-options
440- type : exitcode-stdio-1.0
441- main-is : Streamly/Test/Data/Stream/Top.hs
You can’t perform that action at this time.
0 commit comments