Skip to content

Commit 4f0c76f

Browse files
authored
Tests: adjust test for Windows (#29)
The Windows environment has a smaller stack limit. Without optimizations, we can manage to run up to ~950 recursive calls. With release mode, we are able to get to ~1250. Limit the artificial call depth accordingly. This allows the test suite to pass on Windows.
1 parent a5b00f4 commit 4f0c76f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/MarkdownTests/Performance/EditPerformanceTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ import XCTest
1212
import Markdown
1313

1414
final class EditPerformanceTests: XCTestCase {
15+
#if os(Windows)
16+
#if DEBUG
17+
static let maxDepth = 625
18+
#else
19+
static let maxDepth = 1250
20+
#endif
21+
#else
1522
static let maxDepth = 5000
23+
#endif
1624
/// Test the performance of changing a leaf in an unrealistically deep markup tree.
1725
func testChangeTextInDeepTree() {
1826
func buildDeepListItem(depth: Int) -> ListItem {

0 commit comments

Comments
 (0)