From b6756f8ce3a381a93b4acf5fc4e2fcfee11d3bea Mon Sep 17 00:00:00 2001 From: altair823 Date: Mon, 25 May 2026 09:29:36 +0000 Subject: [PATCH] =?UTF-8?q?chore(tui):=20PR=20#173=20=ED=9A=8C=EC=B0=A8=20?= =?UTF-8?q?1=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test `spawn_snapshot_multi_hop_into_askopts` → `ask_state_multi_hop_field_default_false_and_round_trips` 로 rename. 이전 이름은 spawn 동작 검증을 약속했으나 본문은 단순 field default + setter round-trip 만 검증 — name 과 실제 의도의 mismatch. 새 이름이 실제 검증 (field shape pin) 과 정확히 일치. doc string 도 spawn 동작은 별 path (live dogfood) 로 검증된다고 명확히 표기 — test 의 책임 범위가 무엇인지 reader 가 즉시 파악. 검증 - `cargo test -p kebab-tui -j 1 --test ask` — 42 test (6 multi-hop 포함) 모두 통과. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/kebab-tui/tests/ask.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/kebab-tui/tests/ask.rs b/crates/kebab-tui/tests/ask.rs index 269f9ea..47e7ba4 100644 --- a/crates/kebab-tui/tests/ask.rs +++ b/crates/kebab-tui/tests/ask.rs @@ -1154,18 +1154,15 @@ fn status_panel_omits_hops_summary_for_single_pass() { ); } +/// Light field-shape pin: the toggle exists, is bool, defaults +/// to false, and round-trips through the public `AskState` surface. +/// The actual spawn-time snapshot semantics (toggle value at Enter +/// is the value the worker sees) are guaranteed by the +/// `let multi_hop = s.multi_hop;` line at the top of +/// `spawn_ask_worker` — exercised in live multi-hop dogfood rather +/// than here (worker thread needs Ollama + a real KB). #[test] -fn spawn_snapshot_multi_hop_into_askopts() { - // We can't actually spawn the worker (no Ollama / KB), but we - // can pin the snapshot semantics: the toggle's value at the - // moment of Enter is the value the worker sees. Flipping F2 - // after Enter doesn't retro-affect the in-flight turn. - // - // Strategy: read the toggle directly, then verify the contract - // by inspecting `AskState.multi_hop` after a flip — the - // toggle's "next-turn" semantics are documented but we keep - // the regression light: the field exists, is bool, defaults - // to false, and round-trips through the public surface. +fn ask_state_multi_hop_field_default_false_and_round_trips() { let mut app = fresh_app(); let s = app.ask.as_mut().unwrap(); assert!(!s.multi_hop, "default false"); @@ -1175,6 +1172,7 @@ fn spawn_snapshot_multi_hop_into_askopts() { assert!(!s.multi_hop, "settable back to false"); } + /// Small render helper shared with the rest of the test module's /// buffer-snapshot pattern. We define it locally here to avoid /// reaching into private internals.