File: Function.hs

package info (click to toggle)
haskell-statistics 0.10.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 372 kB
  • ctags: 3
  • sloc: haskell: 2,976; python: 33; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 490 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
module Tests.Function ( tests ) where

import qualified Data.Vector.Unboxed as U
import           Data.Vector.Unboxed   ((!))

import Test.QuickCheck
import Test.Framework
import Test.Framework.Providers.QuickCheck2

import Statistics.Function



tests :: Test
tests = testGroup "S.Function"
  [ testProperty "Sort is sort" p_sort
  ]


p_sort :: [Double] -> Property
p_sort xs =
  not (null xs) ==> U.all (uncurry (<=)) (U.zip v $ U.tail v)
    where
      v = sort $ U.fromList xs