View Source Finitomata.Test.Listener (Finitomata v0.15.0)
The instance of FSM backed up by Finitomata
.
FSM representation
graph TD
idle --> |start| started
started --> |do| done
Summary
Functions
Getter for the internal compiled in FSM information.
Returns the generator to be used in StreamData
-powered property testing, based
on the specification given to use Estructura.Nested
, which contained
Casts the map representation as given to Estructura.Nested.shape/1
to
the nested Estructura
instance.
Returns a specification to start this module under a supervisor.
The convenient macro to allow using states in guards, returns a compile-time
list of states for Finitomata.Test.Listener
.
Gets the value for the given key from the structure
Safely parses the json, applying all the specified validations and coercions
Same as parse/1
but either returns the result of successful parsing or raises
Puts the value for the given key into the structure, passing coercion and validation,
returns {:ok, updated_struct}
or {:error, reason}
if there is no such key
Puts the value for the given key into the structure, passing coercion and validation, returns the value or raises if there is no such key
Starts an FSM alone with name
and payload
given.
Types
Functions
Getter for the internal compiled in FSM information.
@spec __generator__() :: StreamData.t(%Finitomata.Test.Listener{internals: term(), pid: term()})
@spec __generator__(%Finitomata.Test.Listener{internals: term(), pid: term()}) :: StreamData.t(%Finitomata.Test.Listener{internals: term(), pid: term()})
Returns the generator to be used in StreamData
-powered property testing, based
on the specification given to use Estructura.Nested
, which contained
shape
%{
pid: {StreamData, :constant, [#PID<0.177.0>]},
internals: %{counter: {StreamData, :integer, []}}
}
The argument given would be used as a template to generate new values.
Casts the map representation as given to Estructura.Nested.shape/1
to
the nested Estructura
instance.
Returns a specification to start this module under a supervisor.
See Supervisor
.
The convenient macro to allow using states in guards, returns a compile-time
list of states for Finitomata.Test.Listener
.
@spec get( %Finitomata.Test.Listener{internals: term(), pid: term()}, Estructura.Config.key(), any() ) :: any()
Gets the value for the given key from the structure
@spec parse(binary()) :: {:ok, struct()} | {:error, Exception.t()}
Safely parses the json, applying all the specified validations and coercions
Same as parse/1
but either returns the result of successful parsing or raises
@spec put( %Finitomata.Test.Listener{internals: term(), pid: term()}, Estructura.Config.key(), any() ) :: {:ok, %Finitomata.Test.Listener{internals: term(), pid: term()}} | {:error, any()}
Puts the value for the given key into the structure, passing coercion and validation,
returns {:ok, updated_struct}
or {:error, reason}
if there is no such key
@spec put!( %Finitomata.Test.Listener{internals: term(), pid: term()}, Estructura.Config.key(), any() ) :: %Finitomata.Test.Listener{internals: term(), pid: term()} | no_return()
Puts the value for the given key into the structure, passing coercion and validation, returns the value or raises if there is no such key
Starts an FSM alone with name
and payload
given.
Usually one does not want to call this directly, the most common way would be
to start a Finitomata
supervision tree or even better embed it into
the existing supervision tree and start FSM with Finitomata.start_fsm/3
passing Finitomata.Test.Listener
as the first parameter.