chore(tui): PR #173 회차 1 리뷰 반영
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user