From 546d1689b61443dd4e6130539cbc6180bc68b577 Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Wed, 14 Oct 2026 02:25:48 +0000 Subject: [PATCH] test(native): expect only toolchain-portable Swift manglings to demangle The macOS 15 runner's swift-demangle predates Embedded Swift, so valid $e symbols stay unchanged there. Keep $e and _$e in the undecodable half only. Co-Authored-By: Claude Opus 5.5 --- tests/boundary/mcp/nativeDemangleMcp.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/boundary/mcp/nativeDemangleMcp.test.ts b/tests/boundary/mcp/nativeDemangleMcp.test.ts index b6ad1d02c..7bff5fa03 100644 --- a/tests/boundary/mcp/nativeDemangleMcp.test.ts +++ b/tests/boundary/mcp/nativeDemangleMcp.test.ts @@ -78,13 +78,16 @@ describe.skipIf(process.platform !== "darwin")( ); await copyFile("/usr/bin/true", target); const client = await openProductionTarget(mcp, onTestFinished, target); - const prefixes = ["_T0", "$S", "_$S", "$e", "_$e"]; + // Embedded Swift ($e) decoding depends on the installed toolchain, so + // only manglings every supported demangler decodes are expected valid. + const decodable = ["_T0", "$S", "_$S"]; + const prefixes = [...decodable, "$e", "_$e"]; const called = await client.callTool({ name: "demangle_swift", arguments: { symbols: [ - ...prefixes.map((prefix) => `${prefix}4main3FooV`), + ...decodable.map((prefix) => `${prefix}4main3FooV`), ...prefixes.map((prefix) => `${prefix}Bogus`), "_Tprintf", ], @@ -96,7 +99,7 @@ describe.skipIf(process.platform !== "darwin")( .parse(called.structuredContent) .normalized_result.symbols.map(({ status }) => status), ).toEqual([ - ...prefixes.map(() => "demangled"), + ...decodable.map(() => "demangled"), ...prefixes.map(() => "invalid"), "unchanged", ]);