Skip to main content

Module testing

Module testing 

Source
Expand description

Testing utilities for egui-cha applications

§Example

use egui_cha::testing::TestRunner;

#[test]
fn test_counter_flow() {
    let mut runner = TestRunner::<CounterApp>::new();

    runner
        .send(Msg::Increment)
        .send(Msg::Increment)
        .send(Msg::Decrement);

    assert_eq!(runner.model().count, 1);
}

Structs§

FakeClock
A fake clock for testing time-dependent code
TestRunner
A test runner for TEA applications

Enums§

CmdRecord
Record of a command that was returned from update

Traits§

ModelAssert
Extension trait for asserting on model state