sdp-quickcheck-0.2: SDP QuickCheck support
Copyright(c) Andrey Mulik 2019
LicenseBSD-style
Maintainerwork.a.mulik@gmail.com
Portabilitynon-portable (requires non-portable modules)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.SDP.Index

Description

Test.SDP.Index provides basic test suite for Index class.

Synopsis

Shape test

type TestShape s = s -> Bool Source #

TestShape is service type synonym for more comfortable quickCheck using.

shapeTest :: (Shape s, Eq s, Eq (DimInit s), Eq (DimLast s)) => Int -> s -> Bool Source #

shapeTest r sh is default Shape test, where r is expected rank for this shape type. Note that shapeTest also checks rank undefined case, to make sure rank is correct.

Index test

type TestIndex i = (i, i) -> i -> Bool Source #

TestIndex is service type synonym for more comfortable quickCheck using.

indexTest :: Index i => (i, i) -> i -> Bool Source #

indexTest is complex test, that includes all other tests. May crash with very big numbers (Word64, Integer) because the tested functions are limited by size of type Int. In practice, structures of such sizes would take more memory than the address space of computers can accommodate.

Particular tests

basicIndexTest :: Index i => (i, i) -> i -> Bool Source #

basicIndexTest checks relations of rank, size and sizes.

inBoundsTest :: Index i => (i, i) -> i -> Bool Source #

inBoundsTest checks relations of inBounds and other range functions.

rangeTest :: Index i => (i, i) -> i -> Bool Source #

rangeTest checks relations of inRange, isOverflow, isUnderflow and isEmpty.

prevTest :: Index i => (i, i) -> Bool Source #

prevTest checks relations of prev and range.

nextTest :: Index i => (i, i) -> Bool Source #

nextTest checks relations of next and range.

dumbSizeTest :: Index i => (i, i) -> Bool Source #

dumbSizeTest is O(n) (may be very long) test, that checks relation of range size and range length.