Skip to content

Commit 27a6be9

Browse files
committed
StdlibUnittest: add labels to boolean return values
1 parent d7dd6bd commit 27a6be9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,8 @@ struct _ParentProcess {
707707
}
708708

709709
internal mutating func _readFromChild(
710-
onStdoutLine: (String) -> Bool,
711-
onStderrLine: (String) -> Bool
710+
onStdoutLine: (String) -> (done: Bool, Void),
711+
onStderrLine: (String) -> (done: Bool, Void)
712712
) {
713713
var readfds = _stdlib_fd_set()
714714
var writefds = _stdlib_fd_set()
@@ -735,14 +735,14 @@ struct _ParentProcess {
735735
if readfds.isset(_childStdout.fd) || errorfds.isset(_childStdout.fd) {
736736
_childStdout.read()
737737
while let line = _childStdout.getline() {
738-
done = onStdoutLine(line)
738+
(done: done, ()) = onStdoutLine(line)
739739
}
740740
continue
741741
}
742742
if readfds.isset(_childStderr.fd) || errorfds.isset(_childStderr.fd) {
743743
_childStderr.read()
744744
while let line = _childStderr.getline() {
745-
done = onStderrLine(line)
745+
(done: done, ()) = onStderrLine(line)
746746
}
747747
continue
748748
}
@@ -784,7 +784,7 @@ struct _ParentProcess {
784784
var capturedCrashStderr: [String] = []
785785
var anyExpectFailedInChild = false
786786

787-
func processLine(_ line: String, isStdout: Bool) -> Bool {
787+
func processLine(_ line: String, isStdout: Bool) -> (done: Bool, Void) {
788788
var line = line
789789
if let index = findSubstring(line, _stdlibUnittestStreamPrefix) {
790790
let controlMessage =
@@ -809,7 +809,7 @@ struct _ParentProcess {
809809
}
810810
line = line[line.startIndex..<index]
811811
if line.isEmpty {
812-
return stdoutEnd && stderrEnd
812+
return (done: stdoutEnd && stderrEnd, ())
813813
}
814814
}
815815
if isStdout {
@@ -829,7 +829,7 @@ struct _ParentProcess {
829829
} else {
830830
print("stderr>>> \(line)")
831831
}
832-
return stdoutEnd && stderrEnd
832+
return (done: stdoutEnd && stderrEnd, ())
833833
}
834834

835835
_readFromChild(

0 commit comments

Comments
 (0)