assert4hs-core-0.1.0: A set of assertion for writing more readable tests cases
Copyright(c) Pawel Nosal 2021
LicenseMIT
Maintainerp.nosal1986@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010
Extensions
  • BangPatterns
  • OverloadedStrings

Test.Fluent.Assertions.List

Description

This library aims to provide a set of combinators to assert List type.

Synopsis

Documentation

shouldHaveSameSizeAs :: HasCallStack => [a] -> Assertion [a] Source #

assert if given list has same length as expected list

 assertThat [1..10] $ shouldHaveSameSizeAs [0..10]

shouldHaveSizeLowerOrEqual :: HasCallStack => Int -> Assertion [a] Source #

verify if the given list has a length lower or equal to expected value

 assertThat [1..10] $ shouldHaveSizeLowerOrEqual 10

shouldStartWith :: (Eq a, Show a, HasCallStack) => [a] -> Assertion [a] Source #

verify if the given list has expected prefix

 assertThat [1..10] $ shouldStartWith [0..4]

shouldNotStartWith :: (Eq a, Show a, HasCallStack) => [a] -> Assertion [a] Source #

verify if the given list does not start with prefix

 assertThat [1..10] $ shouldNotStartWith [1..4]

shouldHaveSameElements :: (HasCallStack, Eq a, Show a) => [a] -> Assertion [a] Source #

verify if the given list contains same elements as expected list in any order

 assertThat [1..10] $ shouldNotStartWith [1..4]