Skip to content

Commit dc6581f

Browse files
committed
fixed tests, added more version guards
1 parent c47b0a9 commit dc6581f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Data/Vector.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ import Control.DeepSeq ( NFData, rnf )
168168
import Control.Monad ( MonadPlus(..), liftM, ap )
169169
import Control.Monad.ST ( ST )
170170
import Control.Monad.Primitive
171+
172+
173+
#if MIN_VERSION_base(4,4,0)
171174
import Control.Monad.Zip
175+
#endif
172176

173177
import Prelude hiding ( length, null,
174178
replicate, (++), concat,

tests/Tests/Vector.hs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,17 +424,23 @@ testPolymorphicFunctions _ = $(testProperties [
424424
constructrN xs n f = constructrN (f xs : xs) (n-1) f
425425

426426
testTuplyFunctions:: forall a v. (COMMON_CONTEXT(a, v), VECTOR_CONTEXT((a, a), v), VECTOR_CONTEXT((a, a, a), v)) => v a -> [Test]
427-
testTuplyFunctions _ = $(testProperties [ 'prop_zip, 'prop_zip3, 'prop_mzip
428-
, 'prop_unzip, 'prop_unzip3, 'prop_munzip])
427+
testTuplyFunctions _ = $(testProperties [ 'prop_zip, 'prop_zip3
428+
, 'prop_unzip, 'prop_unzip3
429+
#if MIN_VERSION_base(4,4,0)
430+
, 'prop_mzip, 'prop_munzip
431+
#endif
432+
])
429433
where
430434
prop_zip :: P (v a -> v a -> v (a, a)) = V.zip `eq` zip
431435
prop_zip3 :: P (v a -> v a -> v a -> v (a, a, a)) = V.zip3 `eq` zip3
432-
prop_mzip :: P (Data.Vector.Vector a -> Data.Vector.Vector a -> Data.Vector.Vector (a, a))
433-
= V.zip `eq` zip
434436
prop_unzip :: P (v (a, a) -> (v a, v a)) = V.unzip `eq` unzip
435437
prop_unzip3 :: P (v (a, a, a) -> (v a, v a, v a)) = V.unzip3 `eq` unzip3
438+
#if MIN_VERSION_base(4,4,0)
439+
prop_mzip :: P (Data.Vector.Vector a -> Data.Vector.Vector a -> Data.Vector.Vector (a, a))
440+
= mzip `eq` zip
436441
prop_munzip :: P (Data.Vector.Vector (a, a) -> (Data.Vector.Vector a, Data.Vector.Vector a))
437-
= V.unzip `eq` unzip
442+
= munzip `eq` unzip
443+
#endif
438444

439445
testOrdFunctions :: forall a v. (COMMON_CONTEXT(a, v), Ord a, Ord (v a)) => v a -> [Test]
440446
testOrdFunctions _ = $(testProperties

0 commit comments

Comments
 (0)