File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Tests/OpenGraphCxxTests/DebugServer Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,19 @@ public struct ConnectionUpdates: AsyncSequence {
2626
2727@_spi ( Debug)
2828public final class DebugClient {
29+ public enum Command : String , CaseIterable , Hashable {
30+ case graphDescription = " graph/description "
31+ case profilerStart = " profiler/start "
32+ case profilerStop = " profiler/stop "
33+ case profilerReset = " profiler/reset "
34+ case profilerMark = " profiler/mark "
35+ }
36+
2937 private var connection : NWConnection ?
3038 private let queue = DispatchQueue ( label: " org.openswiftuiproject.opengraph.debugclient " )
3139
40+ public init ( ) { }
41+
3242 public func connect( to url: URL ) -> ConnectionUpdates {
3343 guard let host = url. host, let port = url. port else {
3444 return ConnectionUpdates ( stream: AsyncStream { continuation in
Original file line number Diff line number Diff line change @@ -9,13 +9,7 @@ import Testing
99
1010@MainActor
1111struct DebugServerTests {
12- private enum Command : String , CaseIterable , Hashable {
13- case graphDescription = " graph/description "
14- case profilerStart = " profiler/start "
15- case profilerStop = " profiler/stop "
16- case profilerReset = " profiler/reset "
17- case profilerMark = " profiler/mark "
18- }
12+ typealias Command = DebugClient . Command
1913
2014 private func data( for command: Command ) throws -> Data {
2115 let command = [ " command " : command. rawValue]
You can’t perform that action at this time.
0 commit comments