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)