Function hotshot_task_impls::harness::run_harness

source ·
pub async fn run_harness<TYPES, S: TaskState<Event = HotShotEvent<TYPES>> + Send + 'static>(
    input: Vec<HotShotEvent<TYPES>>,
    expected_output: Vec<HotShotEvent<TYPES>>,
    state: S,
    allow_extra_output: bool,
)
where TYPES: NodeType,
Expand description

Runs a test by building the task using build_fn and then passing it the input events and testing the make sure all of the expected_output events are seen

§Arguments

  • event_stream - if given, will be used to register the task builder.
  • allow_extra_output - whether to allow an extra output after we’ve seen all expected outputs. Should be false in most cases.

§Panics

Panics if any state the test expects is not set. Panicking causes a test failure