The test suite is split by the layer it protects. Do not treat all tests as application examples: some are intentionally low-level protocol guards.
integration_smoke.rsis the small liveMoonClienthappy-path smoke test. It uses the same shape a desktop app should use: startMoonClient, wait forLifecycleEvent::Ready, read snapshots/events, then disconnect.fire_test.rsis the live health/stress gate. It also uses the publicMoonClientpath, but it enables diagnostics and destructive scenarios to prove protocol recovery, retained state, and CPU gates. It is not a sample app.
Tests under src/client/tests/ protect protocol mechanics: handshake,
reconnect, PMTU, send queues, pending Engine API routing, subscriptions, and
wire-compatible timing/retry semantics. They may instantiate internal Client or
EventDispatcher directly because their job is to lock down machine-effect
parity, not to demonstrate the public API.
Tests under src/events/tests.rs and src/state/**/tests.rs protect Active Lib
state application and retained read models. Direct state/dispatcher use here is
intentional: these tests prove exact parser/apply behavior without needing a live
server.
udp_polling.rs verifies the OS UDP readiness contract used by the runtime
loop. It is separate from live MoonProto tests because the failure mode is in
socket polling/rearming, not in server behavior.
Fast deterministic checks:
cargo test --lib
cargo test --test udp_polling
cargo check --examplesLive smoke:
cargo test --test integration_smoke -- --ignored --nocaptureFireTest:
$env:MOONPROTO_FIRETEST_PROFILE = "quick"
cargo test --release --features diagnostics --test fire_test fire_test_active_library_health -- --exact --ignored --nocaptureSet MOONPROTO_FIRETEST_PROFILE = "full" for the full health scenario. Keep the
exact name filter: without it, Cargo also runs the separate ignored tests below;
the quick-profile setting does not make those tests read-only.
Focused strategy checks on an updated test core (allow_mutation = true):
cargo test --release --features diagnostics --test fire_test fire_test_strategy_folder_sync -- --exact --ignored --nocapture
cargo test --release --features diagnostics --test fire_test fire_test_strategy_order_sync -- --exact --ignored --nocaptureThese create their own strategy/folder fixtures, check two-way delivery plus cold and reconnected clients, and remove their fixtures. Folder sync covers empty and nested folders, combined rename/path edits, and deletion. Order sync covers reorders with and without parameter edits.
fire_test_core_problems checks diagnostic-list delivery and test notifications;
see its opt-in clear behavior before running it.
fire_test_telegram_state is read-only: initial Telegram state, passive refresh
and a second connection. It never starts login, changes proxy or logs out;
see Telegram.
Live retained-memory warmup check (Windows only):
cargo test --release --features diagnostics --test fire_test fire_test_retained_memory_warmup -- --ignored --nocapture --test-threads=1This check trims the FireTest process working set, then verifies through the
public MoonClient path that its owned history worker restores a materialized
retained ring. It does not mutate the MoonBot server.
Quick FireTest is the frequent development gate. Full FireTest is the destructive/stress gate for “this is a good point” decisions.