Skip to content

Commit b1414b6

Browse files
leogdionclaude
andcommitted
Limit doc test paths on WASM to tutorial files only
Examples/ (2.1MB) and full Documentation.docc (with images) exceed WASM memory constraints. On WASI, use only the two lightweight tutorial .md files (~36KB total). Matches SyndiKit's #if os(WASI) subset pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c90daf8 commit b1414b6

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

Tests/SyntaxDocTests/Settings.swift

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,22 @@ internal enum Settings {
4141
}()
4242

4343
/// Document paths to search for documentation files
44-
internal static let docPaths = [
45-
"Sources/SyntaxKit/Documentation.docc",
46-
"README.md",
47-
"Examples",
48-
]
44+
/// On WASM, limited to lightweight tutorial files only (no images, no Examples)
45+
/// due to WASM memory constraints (~144KB practical limit)
46+
internal static let docPaths: [String] = {
47+
#if os(WASI)
48+
return [
49+
"Sources/SyntaxKit/Documentation.docc/Tutorials/Quick-Start-Guide.md",
50+
"Sources/SyntaxKit/Documentation.docc/Tutorials/Creating-Macros-with-SyntaxKit.md",
51+
]
52+
#else
53+
return [
54+
"Sources/SyntaxKit/Documentation.docc",
55+
"README.md",
56+
"Examples",
57+
]
58+
#endif
59+
}()
4960

5061
/// Resolves a relative file path to absolute path
5162
internal static func resolveFilePath(_ filePath: String) throws -> URL {

0 commit comments

Comments
 (0)