Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Sources/Testing/Running/Runner.Plan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ extension Runner.Plan {
private static func _recursivelySynthesizeSuites(in graph: inout Graph<String, Test?>, nameComponents: [String] = []) {
// The recursive function. This is a local function to simplify the initial
// call which does not need to pass the `sourceLocation:` inout argument.
func synthesizeSuites(in graph: inout Graph<String, Test?>, nameComponents: [String] = [], sourceLocation: inout SourceLocation?) {
func synthesizeSuites(in graph: inout Graph<String, Test?>, nameComponents: inout [String], sourceLocation: inout SourceLocation?) {
for (key, var childGraph) in graph.children {
synthesizeSuites(in: &childGraph, nameComponents: nameComponents + [key], sourceLocation: &sourceLocation)
nameComponents.append(key)
synthesizeSuites(in: &childGraph, nameComponents: &nameComponents, sourceLocation: &sourceLocation)
nameComponents.removeLast()
graph.children[key] = childGraph
}

Expand Down Expand Up @@ -231,8 +233,9 @@ extension Runner.Plan {
}
}

var nameComponents = nameComponents
var sourceLocation: SourceLocation?
synthesizeSuites(in: &graph, sourceLocation: &sourceLocation)
synthesizeSuites(in: &graph, nameComponents: &nameComponents, sourceLocation: &sourceLocation)
}

/// Given an array of tests, synthesize any containing suites that are not
Expand Down
Loading