File: Builder.hs

package info (click to toggle)
haskell-cabal-install 3.12.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,552 kB
  • sloc: haskell: 65,985; sh: 80; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module UnitTests.Distribution.Solver.Modular.Builder
  ( tests
  ) where

import Distribution.Solver.Modular.Builder

import Test.Tasty
import Test.Tasty.QuickCheck

tests :: [TestTree]
tests =
  [ testProperty "splitsAltImplementation" splitsTest
  ]

-- | Simpler splits implementation
splits' :: [a] -> [(a, [a])]
splits' [] = []
splits' (x : xs) = (x, xs) : map (\(y, ys) -> (y, x : ys)) (splits' xs)

splitsTest :: [Int] -> Property
splitsTest xs = splits' xs === splits xs