From 9a1578e49ba9f1cb4f73fdcfd42c1fd33d11171a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 29 Nov 2026 02:09:43 +0100 Subject: [PATCH] thing-tui: pin that building a guard installs the panic hook Per the steward's decision on thing2:finding:cut-tui-host.s1.panic-hook-install-untested. Co-Authored-By: Claude Opus 5.5 --- crates/thing-tui/src/terminal/guard_tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/thing-tui/src/terminal/guard_tests.rs b/crates/thing-tui/src/terminal/guard_tests.rs index b3faca7..65b1b0d 100644 --- a/crates/thing-tui/src/terminal/guard_tests.rs +++ b/crates/thing-tui/src/terminal/guard_tests.rs @@ -118,3 +118,11 @@ fn a_panic_after_the_guard_dropped_writes_nothing() { owner_panics(&next); assert_eq!(count(&at_hand_over().expect("hook ran"), LEAVE), 1); } +#[test] +fn building_a_guard_installs_the_hook() { + let out = Shared::default(); + owner_panics(&out); + let seen = at_hand_over().expect("the previous hook was reached"); + assert_eq!(count(&seen, LEAVE), 1, "restored before the previous hook, by the hook"); +} +