| Copyright | (c) Andrey Mulik 2019 |
|---|---|
| License | BSD-style |
| Maintainer | work.a.mulik@gmail.com |
| Portability | non-portable (requires non-portable modules) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Test.SDP.Index
Description
Test.SDP.Index provides basic test suite for Index class.
Synopsis
- type TestShape s = s -> Bool
- shapeTest :: (Shape s, Eq s, Eq (DimInit s), Eq (DimLast s)) => Int -> s -> Bool
- type TestIndex i = (i, i) -> i -> Bool
- indexTest :: Index i => (i, i) -> i -> Bool
- basicIndexTest :: Index i => (i, i) -> i -> Bool
- inBoundsTest :: Index i => (i, i) -> i -> Bool
- rangeTest :: Index i => (i, i) -> i -> Bool
- prevTest :: Index i => (i, i) -> Bool
- nextTest :: Index i => (i, i) -> Bool
- dumbSizeTest :: Index i => (i, i) -> Bool
Shape test
type TestShape s = s -> Bool Source #
TestShape is service type synonym for more comfortable quickCheck using.
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.
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.