-- Do not edit! Automatically created with doctest-extract from src/Data/Array/Comfort/Storable/Unchecked.hs {-# LINE 66 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} module DocTest.Data.Array.Comfort.Storable.Unchecked where import Test.DocTest.Base import qualified Test.DocTest.Driver as DocTest {-# LINE 67 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} import DocTest.Data.Array.Comfort.Storable (ShapeInt, genArray) import qualified Data.Array.Comfort.Storable as Array import qualified Data.Array.Comfort.Shape as Shape import Data.Array.Comfort.Storable (Array, (!)) import qualified Test.QuickCheck as QC import Test.QuickCheck ((==>)) import Data.Word (Word16) newtype Array16 = Array16 (Array ShapeInt Word16) deriving (Show) instance QC.Arbitrary Array16 where arbitrary = fmap Array16 genArray newtype CyclicArray16 = CyclicArray16 (Array (Shape.Cyclic Int) Word16) deriving (Show) instance QC.Arbitrary CyclicArray16 where arbitrary = fmap (CyclicArray16 . Array.mapShape (\(Shape.ZeroBased n) -> Shape.Cyclic n)) genArray test :: DocTest.T () test = do DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:178: " {-# LINE 178 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 178 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \x -> Array.singleton x ! () == (x::Word16) ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:192: " {-# LINE 192 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 192 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(QC.NonNegative n) (Array16 x) -> x == Array.mapShape (Shape.ZeroBased . Shape.size) (Array.append (Array.take n x) (Array.drop n x)) ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:207: " {-# LINE 207 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 207 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(Array16 x) (Array16 y) -> let xy = Array.append x y in x == Array.takeLeft xy && y == Array.takeRight xy ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:227: " {-# LINE 227 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 227 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(Array16 x) (Array16 y) (Array16 z) -> let xyz = Array.append x $ Array.append y z in y == Array.takeCenter xyz ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:239: " {-# LINE 239 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.example( {-# LINE 239 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} Array.rotateLeft 1 (Array.fromList (Shape.Cyclic (5::Int)) "abcde") ) [ExpectedLine [WildCardChunk,LineChunk "fromList ",WildCardChunk,LineChunk " \"bcdea\""]] DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:242: " {-# LINE 242 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 242 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(CyclicArray16 x) -> x == Array.rotateLeft 0 x ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:244: " {-# LINE 244 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 244 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \m n (CyclicArray16 x) -> Array.rotateLeft m (Array.rotateLeft n x) == Array.rotateLeft (m+n) x ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:251: " {-# LINE 251 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 251 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(CyclicArray16 x) k j -> Shape.size (Array.shape x) > 0 ==> Array.rotateLeft j x ! k == x!(j+k) ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:268: " {-# LINE 268 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.example( {-# LINE 268 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} Array.rotateRight 1 (Array.fromList (Shape.Cyclic (5::Int)) "abcde") ) [ExpectedLine [WildCardChunk,LineChunk "fromList ",WildCardChunk,LineChunk " \"eabcd\""]] DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:271: " {-# LINE 271 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 271 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \k (CyclicArray16 x) -> Array.rotateLeft k x == Array.rotateRight (-k) x ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:280: " {-# LINE 280 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 280 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(Array16 xs) -> Array.sum xs == sum (Array.toList xs) ) DocTest.printPrefix "Data.Array.Comfort.Storable.Unchecked:286: " {-# LINE 286 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} DocTest.property( {-# LINE 286 "src/Data/Array/Comfort/Storable/Unchecked.hs" #-} \(Array16 xs) -> Array.product xs == product (Array.toList xs) )