From fbccd00826f746e9df09c107f6f810f1af52f759 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 2 Apr 2026 15:13:26 -0400 Subject: [PATCH 1/2] Fix Android doc test path resolution On Android, Documentation.docc is copied flat to the working directory without the Sources/SyntaxKit/ prefix. Centralize the prefix logic in resolveFilePath so test methods use short paths and Settings adds the prefix for non-Android platforms. Co-Authored-By: Claude Sonnet 4.6 --- Tests/SyntaxDocTests/DocumentationExampleTests.swift | 4 ++-- Tests/SyntaxDocTests/Settings.swift | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Tests/SyntaxDocTests/DocumentationExampleTests.swift b/Tests/SyntaxDocTests/DocumentationExampleTests.swift index 602462d..d2222f7 100644 --- a/Tests/SyntaxDocTests/DocumentationExampleTests.swift +++ b/Tests/SyntaxDocTests/DocumentationExampleTests.swift @@ -42,7 +42,7 @@ internal struct DocumentationExampleTests { @Test("Quick Start Guide examples work correctly") internal func validateQuickStartGuideExamples() throws { let quickStartFile = try Settings.resolveFilePath( - "Sources/SyntaxKit/Documentation.docc/Tutorials/Quick-Start-Guide.md" + "Documentation.docc/Tutorials/Quick-Start-Guide.md" ) let results = try testHarness.validateFile(at: quickStartFile) @@ -57,7 +57,7 @@ internal struct DocumentationExampleTests { @Test("Creating Macros tutorial examples work correctly") internal func validateMacroTutorialExamples() throws { let macroTutorialFile = try Settings.resolveFilePath( - "Sources/SyntaxKit/Documentation.docc/Tutorials/Creating-Macros-with-SyntaxKit.md" + "Documentation.docc/Tutorials/Creating-Macros-with-SyntaxKit.md" ) let results = try testHarness.validateFile(at: macroTutorialFile) diff --git a/Tests/SyntaxDocTests/Settings.swift b/Tests/SyntaxDocTests/Settings.swift index b9825e4..5719749 100644 --- a/Tests/SyntaxDocTests/Settings.swift +++ b/Tests/SyntaxDocTests/Settings.swift @@ -81,7 +81,12 @@ internal enum Settings { return .init(fileURLWithPath: filePath) } } else { - return Self.projectRoot.appendingPathComponent(filePath) + #if os(Android) + let resolvedPath = filePath + #else + let resolvedPath = "Sources/SyntaxKit/" + filePath + #endif + return Self.projectRoot.appendingPathComponent(resolvedPath) } } } From 72cbd0210eb5df7cef64be17e7a8aebad7e63ad1 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 2 Apr 2026 15:21:17 -0400 Subject: [PATCH 2/2]