packages feed

comfort-array-0.5.2.1: test/DocTest/Data/Array/Comfort/Boxed/Unchecked.hs

-- Do not edit! Automatically created with doctest-extract from src/Data/Array/Comfort/Boxed/Unchecked.hs
{-# LINE 38 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}

module DocTest.Data.Array.Comfort.Boxed.Unchecked where

import qualified Test.DocTest.Driver as DocTest

{-# LINE 39 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
import     qualified Data.Array.Comfort.Boxed as Array
import     qualified Data.Array.Comfort.Shape as Shape
import     Data.Array.Comfort.Boxed (Array)
import     Control.Applicative ((<$>))

import     qualified Test.QuickCheck as QC

type     ShapeInt = Shape.ZeroBased Int

genArray     :: QC.Gen (Array ShapeInt Char)
genArray     = Array.vectorFromList <$> QC.arbitrary

newtype     ArrayChar = ArrayChar (Array ShapeInt Char)
       deriving (Show)

instance     QC.Arbitrary ArrayChar where
       arbitrary = fmap ArrayChar genArray

test :: DocTest.T ()
test = do
 DocTest.printPrefix "Data.Array.Comfort.Boxed.Unchecked:165: "
{-# LINE 165 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
 DocTest.property
{-# LINE 165 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
     (\(QC.NonNegative n) (ArrayChar x)  ->  x == Array.mapShape (Shape.ZeroBased . Shape.size) (Array.append (Array.take n x) (Array.drop n x)))
 DocTest.printPrefix "Data.Array.Comfort.Boxed.Unchecked:180: "
{-# LINE 180 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
 DocTest.property
{-# LINE 180 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
     (\(ArrayChar x) (ArrayChar y) -> let xy = Array.append x y in x == Array.takeLeft xy  &&  y == Array.takeRight xy)
 DocTest.printPrefix "Data.Array.Comfort.Boxed.Unchecked:200: "
{-# LINE 200 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
 DocTest.property
{-# LINE 200 "src/Data/Array/Comfort/Boxed/Unchecked.hs" #-}
     (\(ArrayChar x) (ArrayChar y) (ArrayChar z) -> let xyz = Array.append x $ Array.append y z in y == Array.takeCenter xyz)