From 3c802ce0073cc1fcd64ab4fd08f18ddc427dfa70 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 10:23:37 +0000 Subject: [PATCH] tsc-platform: crash report test independent of path separators Panic locations use backslashes on Windows, and backtrace symbols need the PDB files there, so those checks are relaxed or Linux only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G --- crates/tsc-platform/tests/crash.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/tsc-platform/tests/crash.rs b/crates/tsc-platform/tests/crash.rs index 65d5e61..739cd60 100644 --- a/crates/tsc-platform/tests/crash.rs +++ b/crates/tsc-platform/tests/crash.rs @@ -48,10 +48,14 @@ fn panic_hook_writes_reports() { assert!(text.contains("Thread: crash-test ("), "{text}"); assert!(text.contains("Message: boom 42\n second line"), "{text}"); assert!(text.contains(&format!("System: {}", std::env::consts::OS)), "{text}"); - assert!(text.contains("Location: crates/tsc-platform/tests/crash.rs:"), "{text}"); + // The path separator is the platform's. + let location = text.lines().find(|l| l.starts_with("Location: ")).unwrap_or_default(); + assert!(location.contains("tests") && location.contains("crash.rs:"), "{text}"); assert!(text.contains("Backtrace:\n"), "{text}"); - // Line tables are on in the dev profile: the backtrace names this file. - assert!(text.contains("panic_in_thread"), "{text}"); + // Symbols resolve on Linux (MSVC needs the PDB files next to the binary). + if cfg!(target_os = "linux") { + assert!(text.contains("panic_in_thread"), "{text}"); + } // No partial files are left behind. assert_eq!(std::fs::read_dir(&dir).unwrap().count(), 1);