Skip to content

Commit 56fa3e5

Browse files
committed
[stdlib][test] Update string printing availability checks
The change in behaviour that these checks covered is not currently in 6.0, only in main. Update the availability check to use stdlib 6.1.
1 parent 31a9cd9 commit 56fa3e5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

β€Žtest/stdlib/BridgedObjectDebuggerSupport.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ StringForPrintObjectTests.test("NSStringUTF8") {
7878
expectEqual("πŸ‚β˜ƒβ…β†β„οΈŽβ›„οΈβ„οΈ", String(reflecting: nsUTF16))
7979
expectEqual("\"πŸ‚β˜ƒβ…β†β„οΈŽβ›„οΈβ„οΈ\"", String(reflecting: newNSUTF16))
8080

81-
if #available(SwiftStdlib 6.0, *) {
81+
if #available(SwiftStdlib 6.1, *) {
8282
expectEqual("πŸ‚β˜ƒβ…β†β„οΈŽβ›„οΈβ„οΈ\n", printed)
83+
} else {
84+
expectEqual("\"πŸ‚β˜ƒβ…β†β„οΈŽβ›„οΈβ„οΈ\"\n", printed)
8385
}
8486

8587
expectEqual(printed, debug)

β€Žtest/stdlib/DebuggerSupport.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,16 @@ StringForPrintObjectTests.test("DontBridgeThisStruct") {
101101
}
102102
#endif
103103

104-
if #available(SwiftStdlib 6.0, *) {
104+
if #available(SwiftStdlib 6.1, *) {
105105
StringForPrintObjectTests.test("String") {
106106
let printed = _stringForPrintObject("hello\nworld")
107107
expectEqual(printed, "hello\nworld\n")
108108
}
109+
} else {
110+
StringForPrintObjectTests.test("String") {
111+
let printed = _stringForPrintObject("hello\nworld")
112+
expectEqual(printed, "\"hello\\nworld\"\n")
113+
}
109114
}
110115

111116
class RefCountedObj {

0 commit comments

Comments
Β (0)