File: Builder.hs

package info (click to toggle)
haskell-cabal-install 3.10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 3,400 kB
  • sloc: haskell: 52,202; sh: 80; makefile: 9
file content (20 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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