Packages
Construct streams of values by specifying composable generator functions. For example list(tuple(like: {atom, string})) will generate a random length keyword list with random keys and values. Constraints can be applied at all levels.
Current section
Files
Jump to
Current section
Files
lib/pollution/generators/value.ex
defmodule Pollution.Generator.Value do
@behaviour Pollution.Generator
alias Pollution.State
@state %State {
type: __MODULE__
}
def create([value: value]) do
%State{ @state | last_value: value }
end
def next_value(state, _locals) do
{ state.last_value, state }
end
end