Tezos_alpha_test_helpers.Scenario_dslSourcetype ('input, 'output) scenarios = | Action : ('input ->
'output Tezos_base.TzPervasives.tzresult Lwt.t) -> ('input, 'output)
scenarios| Empty : ('t, 't) scenarios| Concat : (('a, 'b) scenarios * ('b, 'c) scenarios) -> ('a, 'c) scenarios| Branch : (('a, 'b) scenarios * ('a, 'b) scenarios) -> ('a, 'b) scenarios| Tag : string -> ('t, 't) scenarios| Slow : ('t, 't) scenariosA scenario is a succession of actions. We define a branching path as a way to create multiple tests from the same point. This allows easy compositionality of behaviors with minimal code sharing. The Tag allows to give meaningful identifiers to the branches. It is good practice to tag each case in a branch (it's not necessary, but since test names must be unique, at most one branch can remain unnamed, and even then it can create conflicting names.)
type ('input, 'output) single_scenario = | End_scenario : ('t, 't) single_scenario| Cons : (('input ->
't Tezos_base.TzPervasives.tzresult Lwt.t)
* ('t, 'output) single_scenario) -> ('input, 'output) single_scenarioUnfolded scenario type
val cat_ss :
'a 'b 'c. ('a, 'b) single_scenario ->
('b, 'c) single_scenario ->
('a, 'c) single_scenarioval unfold_scenarios :
'input 'output. ('input, 'output) scenarios ->
(('input, 'output) single_scenario * string list * bool) listval run_scenario :
'input 'output. ('input, 'output) single_scenario ->
'input ->
'output Tezos_base.TzPervasives.tzresult Lwt.tUseful aliases and operators
Continuation connector: execute a then b
Branching connector: creates two tests with different execution paths
Transforms scenarios into tests
Arbitrary execution
val exec_state :
(('a * 'b) -> ('c, Tezos_base.TzPervasives.tztrace) result Lwt.t) ->
('a * 'b, 'a * 'c) scenariosExecute a function that does not modify the block, only the state
val exec_unit :
('a -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t) ->
('a, 'a) scenariosExecute a function that does not modify neither the block nor the state. Usually used for checks/asserts
fold f l folds f over l, fails on empty list
fold_tag f l folds f over l, l has a tag for each of its elements. Fails on empty list.