Skip to content

Commit 7407568

Browse files
committed
Specify an encoding
1 parent b8cdb90 commit 7407568

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/LLVMTests/FileCheck.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public func fileCheckOutput(of FD : FileCheckFD = .stdout, withPrefixes prefixes
107107
}
108108

109109
private func overrideFDAndCollectOutput(file : FileCheckFD, of block : () -> ()) -> String {
110-
fflush(stdout)
110+
fflush(file.filePtr)
111111
let oldFd = dup(file.fileno)
112112

113113
let template = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("output.XXXXXX")
@@ -133,7 +133,7 @@ private func overrideFDAndCollectOutput(file : FileCheckFD, of block : () -> ())
133133
close(oldFd)
134134

135135
let url = URL(fileURLWithFileSystemRepresentation: buffer, isDirectory: false, relativeTo: nil)
136-
guard let s = try? String(contentsOf: url) else {
136+
guard let s = try? String(contentsOf: url, encoding: .utf8) else {
137137
return ""
138138
}
139139
return s

0 commit comments

Comments
 (0)