File: Storable.hs

package info (click to toggle)
haskell-vector 0.13.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 996 kB
  • sloc: haskell: 11,004; ansic: 6; makefile: 3
file content (40 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{-# LANGUAGE ConstraintKinds #-}
module Tests.Vector.Storable (tests) where

import Test.Tasty
import qualified Data.Vector.Storable
import Tests.Vector.Property

import GHC.Exts (inline)

testGeneralStorableVector
  :: forall a. ( CommonContext a Data.Vector.Storable.Vector
               , Data.Vector.Storable.Storable a, Ord a, Data a)
  => Data.Vector.Storable.Vector a -> [TestTree]
testGeneralStorableVector dummy = concatMap ($ dummy)
  [
    testSanity
  , inline testPolymorphicFunctions
  , testOrdFunctions
  , testMonoidFunctions
  , testDataFunctions
  ]

testNumericStorableVector
  :: forall a. ( CommonContext a Data.Vector.Storable.Vector
               , Data.Vector.Storable.Storable a, Ord a, Num a, Enum a, Random a, Data a)
  => Data.Vector.Storable.Vector a -> [TestTree]
testNumericStorableVector dummy = concatMap ($ dummy)
  [
    testGeneralStorableVector
  , testNumFunctions
  , testEnumFunctions
  ]

tests =
  [ testGroup "Data.Vector.Storable.Vector (Int)" $
    testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Int)
  , testGroup "Data.Vector.Storable.Vector (Double)" $
    testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Double)
  , testGroup "unstream" $ testUnstream (undefined :: Data.Vector.Storable.Vector Int)
  ]