Skip to content

Commit 3027784

Browse files
committed
StdlibUnittest: add a workraound for DOS lineendings
Windows uses DOS line endings which appear through the PIPE endpoints. We currently split on line feeds only, leaving the carriage return in place. Without this, the messages on the communication pipe would not be interpreted correctly.
1 parent 335ea14 commit 3027784

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ class _ParentProcess {
10291029
omittingEmptySubsequences: false)
10301030
switch controlMessage[1] {
10311031
case "expectCrash":
1032+
fallthrough
1033+
case "expectCrash\r":
10321034
if isStdout {
10331035
stdoutSeenCrashDelimiter = true
10341036
anyExpectFailedInChild = controlMessage[2] == "true"
@@ -1037,6 +1039,8 @@ class _ParentProcess {
10371039
expectingPreCrashMessage = String(controlMessage[2])
10381040
}
10391041
case "end":
1042+
fallthrough
1043+
case "end\r":
10401044
if isStdout {
10411045
stdoutEnd = true
10421046
anyExpectFailedInChild = controlMessage[2] == "true"

0 commit comments

Comments
 (0)