Crate fixt[][src]

Re-exports

pub use paste;

Modules

bool
bytes
number
prelude
serialized_bytes

@todo move all this out to the serialized bytes crate

string
unit

Macros

basic_test
curve

implement Iterator for a FooFixturator for a given curve

enum_fixturator

Creates a simple way to generate enums that use the strum way of iterating https://docs.rs/strum/0.18.0/strum/ iterates over all the variants (Predictable) or selects random variants (Unpredictable) You do still need to BYO “empty” variant as the macro doesn’t know what to use there

fixt

tiny convenience macro to make it easy to get the first Foo from its fixturator without using the iterator interface to save a little typing c.f. fixt!(Foo) vs. FooFixturator::new(Unpredictable).next().unwrap();

fixturator

implements a FooFixturator for any type Foo this simply wraps Fixturator<Foo, Curve> up as FooFixturator

get_fixt_curve
get_fixt_index
newtype_fixturator

a direct delegation of fixtures to the inner type for new types

set_fixt_index
wasm_io_fixturator

a direct delegation of fixtures to the inner type for wasm io types See zome types crate

Structs

Empty

represents a curve over the empty value(s) the concept of “empty” is as slippery as it is of dubious value how many countless hours and bugs have we lost over deciding what “is” and what “isn’t”? i’m looking at you, JS and PHP -_-

Fixturator

the Fixturator is the struct that we wrap in our FooFixturator newtypes to impl Iterator over each combination of Item and Curve needs its own Iterator implementation for Fixturator Item is the Foo type of FooFixturator, i.e. the type of thing we are generating examples of Curve represents some algorithm capable of generating fixtures the Item is PhantomData because it simply represents a type to output the Curve must be provided when the Fixturator is constructed to allow for paramaterized curves this is most easily handled in most cases with the fixturator! and newtype_fixturator! macros

Predictable

represents a predictable curve

Unpredictable

represents an unpredictable curve

Functions

rng

Access the seeded random number generator. This should be used in all places where tests produce random values.