From 605045faeb0ca2a16884ee8d4a05139c0544f496 Mon Sep 17 00:00:00 2001 From: AJ Emory <239216119+ajemory@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:37:16 -0700 Subject: [PATCH] Fix `make test` SIGSEGV on Swift 6.2 (#1638) - Closes #1637. --- Tests/ContainerCommandsTests/HelpCommandTests.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Tests/ContainerCommandsTests/HelpCommandTests.swift b/Tests/ContainerCommandsTests/HelpCommandTests.swift index a728c0fe..0e5c1c53 100644 --- a/Tests/ContainerCommandsTests/HelpCommandTests.swift +++ b/Tests/ContainerCommandsTests/HelpCommandTests.swift @@ -32,14 +32,16 @@ struct HelpCommandTests { for child in children { guard let name = child.configuration.commandName else { continue } let canonical = path + [name] + let canonicalResolved = HelpCommand.resolveSubcommand(path: canonical) != nil #expect( - HelpCommand.resolveSubcommand(path: canonical) != nil, + canonicalResolved, "help should resolve '\(canonical.joined(separator: " "))' but returned nil" ) for alias in child.configuration.aliases { let aliasPath = path + [alias] + let aliasResolved = HelpCommand.resolveSubcommand(path: aliasPath) != nil #expect( - HelpCommand.resolveSubcommand(path: aliasPath) != nil, + aliasResolved, "help should resolve alias path '\(aliasPath.joined(separator: " "))' but returned nil" ) } @@ -51,7 +53,9 @@ struct HelpCommandTests { @Test func unknownSubcommandReturnsNil() { - #expect(HelpCommand.resolveSubcommand(path: ["nonexistent"]) == nil) - #expect(HelpCommand.resolveSubcommand(path: ["image", "nonexistent"]) == nil) + let unknownResolved = HelpCommand.resolveSubcommand(path: ["nonexistent"]) == nil + #expect(unknownResolved) + let nestedUnknownResolved = HelpCommand.resolveSubcommand(path: ["image", "nonexistent"]) == nil + #expect(nestedUnknownResolved) } }