Skip to main content

Module test_support

Module test_support 

Source
Expand description

Test helpers for asserting store/reducer paths do not clone feature state.

Wrap reducer state types with [panic_on_state_clone!] and allow only explicit clones via allow_state_clones.

Functions§

allow_state_clones
Temporarily allow count feature-state clones on this thread.
on_state_clone
Panics unless the current thread has remaining clone budget from allow_state_clones.
replay_snapshot
[ReplayHarness::snapshot] clones feature state once.
scoped_child_state
[ScopedStore::child_state] clones parent state once via [Store::state].
scoped_subscribe_state
[ScopedStore::subscribe_state] clones parent state once when the subscriber is created.
scoped_subscriber_next
One ScopedStateSubscriber::next may clone parent feature state once.
shared_get
[Shared::get] clones feature state once.
shared_with_mut
[Shared::with_mut] clones feature state once to detect changes.
store_state
[Store::state] clones feature state once — use in tests that intentionally read a snapshot.
subscribe_state
[Store::subscribe_state] clones once when the subscriber is created.
subscriber_wait_next
One StateSubscriber::next / StateSubscriber::wait_next may clone feature state once.