Zafu/Testing/HedgeHogsource code:
public dependencies: Zafu/Abstract/Applicative,
Zafu/Abstract/Monad,
Zafu/Collection/LazyTree,
Zafu/Testing/HedgeHog/Seed,
Zafu/Testing/HedgeHog/Size
Gen, Propascii_char_Gen, bool_Gen, char_Gen, comparison_Gen, const_Gen, exact_list_Gen, fixed_size_Gen, flat_map_Gen, float64_Gen, forall_Prop, forall_True_Prop, forall_show_Prop, geometric_Int_Gen, int32_Gen, int_Gen, int_between_Gen, int_range_Gen, list_Gen, map2_Gen, map_Gen, monad_Gen, no_shrink_Gen, option_Gen, pos_Int_Gen, product_applicative_Gen,
run_Gen, run_Prop, scale_Gen, sequence_Gen, short_ascii_Gen, smaller_Gen, string_Gen, suite_Prop, traverse_Gen, tuple2_Gen, tuple3_Gen, tuple4_Gen, uint32_Gen, unit_Float64_Gen, unit_Gen, with_bounded_uint32_GenGen[a]HedgeHog generator with shrink tree threaded through Size and Seed.
type Gen[a: +*]
PropHedgeHog property that expands into a Test after sampling.
type Prop
ascii_char_GenGenerator for printable ASCII characters.
ascii_char_Gen: Gen[Char]
bool_GenGenerator for Bool values.
bool_Gen: Gen[Bool]
char_GenGenerator that mixes ASCII and multibyte UTF-8 characters.
char_Gen: Gen[Char]
comparison_GenGenerator for LT, EQ, and GT values.
references: Comparison,
Gen
comparison_Gen: Gen[Comparison]
const_GenBuild a generator that always returns the same value.
references: Gen
def const_Gen[a](value: a) -> Gen[a]
exact_list_Gendef exact_list_Gen[a](length: Int, gen: Gen[a]) -> Gen[List[a]]
fixed_size_GenOverride the size seen by a generator.
references: Gen, Zafu/Testing/HedgeHog/Size::Size
def fixed_size_Gen[a](gen: Gen[a], fixed_size: Zafu/Testing/HedgeHog/Size::Size) -> Gen[a]
flat_map_GenSequence generators while threading size, seed, and shrink trees.
references: Gen
def flat_map_Gen[a, b](gen: Gen[a], fn: a -> Gen[b]) -> Gen[b]
float64_GenGenerator for finite Float64 values with basic shrinking.
float64_Gen: Gen[Float64]
forall_PropCommon-case property builder with default sample rendering.
references: Gen, Prop, String, Test
def forall_Prop[a](gen: Gen[a], name: String, test_fn: a -> Test) -> Prop
forall_True_Propreferences: Bool, Gen, Prop, String
def forall_True_Prop[a](gen: Gen[a], name: String, show: a -> String, fn: a -> Bool) -> Prop
forall_show_PropBuild a property by testing generated values and shrinking failures.
references: Gen, Prop, String, Test
def forall_show_Prop[a](gen: Gen[a], name: String, show: a -> String, test_fn: a -> Test) -> Prop
geometric_Int_GenGenerator for non-negative Int values with geometric distribution by mean.
def geometric_Int_Gen(mean: Float64) -> Gen[Int]
int32_GenGenerator focused on 32-bit signed Int values.
int32_Gen: Gen[Int]
int_GenGenerator for signed Int values across several size-scaled ranges.
int_Gen: Gen[Int]
int_between_GenGenerator for Int values in [low, high), clamped to low when high <= low.
def int_between_Gen(low: Int, high_exclusive: Int) -> Gen[Int]
int_range_GenGenerator for Int values in [0, upper), clamped to 0 when upper <= 0.
def int_range_Gen(upper: Int) -> Gen[Int]
list_GenGenerator for short lists of generated values.
def list_Gen[a](gen: Gen[a]) -> Gen[List[a]]
map2_Genreferences: Gen
def map2_Gen[a, b, c](left: Gen[a], right: Gen[b], fn: (a, b) -> c) -> Gen[c]
map_GenMap over generated values without changing the shrink structure.
references: Gen
def map_Gen[a, b](gen: Gen[a], to: a -> b) -> Gen[b]
monad_Genreferences: Gen, Zafu/Abstract/Monad::Monad
monad_Gen: Zafu/Abstract/Monad::Monad[Gen]
no_shrink_GenLift a sampler with no shrink candidates into a generator.
references: Gen, Tuple2, Zafu/Testing/HedgeHog/Seed::Seed,
Zafu/Testing/HedgeHog/Size::Size
def no_shrink_Gen[a](
run_value: (Zafu/Testing/HedgeHog/Size::Size, Zafu/Testing/HedgeHog/Seed::Seed) -> (Zafu/Testing/HedgeHog/Seed::Seed, a)
) -> Gen[a]
option_GenLift a generator into Option, including None as a shrink candidate.
def option_Gen[a](gen: Gen[a]) -> Gen[Option[a]]
pos_Int_GenGenerator for positive Int values.
pos_Int_Gen: Gen[Int]
product_applicative_GenProduct applicative using map2_Gen's paired shrink trees. This generally shrinks better for independent products, but it is not the Applicative aligned with flat_map_Gen / monad_Gen because map2_Gen does not preserve the same left-to-right sequencing semantics.
references: Gen, Zafu/Abstract/Applicative::Applicative
product_applicative_Gen: Zafu/Abstract/Applicative::Applicative[Gen]
run_GenRun a generator at a specific size and seed.
references: Gen, Tuple2, Zafu/Collection/LazyTree::LazyTree,
Zafu/Testing/HedgeHog/Seed::Seed,
Zafu/Testing/HedgeHog/Size::Size
def run_Gen[a
](gen: Gen[a], size: Zafu/Testing/HedgeHog/Size::Size, seed: Zafu/Testing/HedgeHog/Seed::Seed) -> Zafu/Collection/LazyTree::LazyTree[(Zafu/Testing/HedgeHog/Seed::Seed, a)]
run_PropRun a property with a sample count and integer seed.
def run_Prop(prop: Prop, count: Int, seed: Int) -> Test
scale_GenTransform the size before running a generator.
references: Gen, Zafu/Testing/HedgeHog/Size::Size
def scale_Gen[a
](gen: Gen[a], scale: Zafu/Testing/HedgeHog/Size::Size -> Zafu/Testing/HedgeHog/Size::Size) -> Gen[a]
sequence_GenSequence a list of generators into a generator of lists.
def sequence_Gen[a](gens: List[Gen[a]]) -> Gen[List[a]]
short_ascii_GenGenerator for short printable ASCII strings.
short_ascii_Gen: Gen[String]
smaller_GenRun a generator at a smaller, golden-ratio-scaled size.
references: Gen
def smaller_Gen[a](gen: Gen[a]) -> Gen[a]
string_GenGenerator for short strings with mixed ASCII/UTF-8 chars.
string_Gen: Gen[String]
suite_PropGroup several properties under a named test suite.
references: List, Prop, String
def suite_Prop(name: String, props: List[Prop]) -> Prop
traverse_GenTraverse a list with a generator-producing function.
def traverse_Gen[a, b](items: List[a], fn: a -> Gen[b]) -> Gen[List[b]]
tuple2_GenCombine two generators into a generator for pairs.
def tuple2_Gen[a, b](left: Gen[a], right: Gen[b]) -> Gen[(a, b)]
tuple3_GenCombine three generators into a generator for triples.
def tuple3_Gen[a, b, c](ga: Gen[a], gb: Gen[b], gc: Gen[c]) -> Gen[(a, b, c)]
tuple4_GenCombine four generators into a generator for 4-tuples.
def tuple4_Gen[a, b, c, d](ga: Gen[a], gb: Gen[b], gc: Gen[c], gd: Gen[d]) -> Gen[(a, b, c, d)]
uint32_GenGenerator for non-negative 32-bit unsigned-like Int values.
uint32_Gen: Gen[Int]
unit_Float64_Genunit_Float64_Gen: Gen[Float64]
unit_GenGenerator for Unit.
unit_Gen: Gen[()]
with_bounded_uint32_GenPair generated values with an independent bounded Int derived from the value.
def with_bounded_uint32_Gen[a](base: Gen[a], upper: a -> Int, shift: Int) -> Gen[(a, Int)]