Skip to content

Commit 20f8f83

Browse files
committed
Output reduced test case as bytes instead of a string
This allows us to reduce invalid UTF-8, which were lossily converted when creating a `String`.
1 parent 88eb8eb commit 20f8f83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/swift-parser-cli/swift-parser-cli.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class Reduce: ParsableCommand {
427427
if verbose {
428428
printerr("Reduced from \(source.count) to \(reduced.count) characters in \(checks) iterations")
429429
}
430-
let reducedString = String(decoding: reduced, as: UTF8.self)
431-
print(reducedString)
430+
431+
FileHandle.standardOutput.write(Data(reduced))
432432
}
433433
}

0 commit comments

Comments
 (0)