@@ -47,9 +47,9 @@ struct DiagnosticTest : ExpressibleByStringLiteral, Hashable, CustomStringConver
4747
4848 var mappedToExpression : Self {
4949 DiagnosticTest (
50- message. _replacing ( " Predicate " , with: " Expression " ) . _replacing ( " predicate " , with: " expression " ) ,
50+ message. replacing ( " Predicate " , with: " Expression " ) . replacing ( " predicate " , with: " expression " ) ,
5151 fixIts: fixIts. map {
52- FixItTest ( $0. message, result: $0. result. _replacing ( " #Predicate " , with: " #Expression " ) )
52+ FixItTest ( $0. message, result: $0. result. replacing ( " #Predicate " , with: " #Expression " ) )
5353 }
5454 )
5555 }
@@ -100,7 +100,7 @@ extension Diagnostic {
100100 } else {
101101 var result = " Message: \( debugDescription) \n Fix-Its: \n "
102102 for fixIt in fixIts {
103- result += " \t \( fixIt. message. message) \n \t \( fixIt. changes. first!. _result. _replacing ( " \n " , with: " \n \t " ) ) "
103+ result += " \t \( fixIt. message. message) \n \t \( fixIt. changes. first!. _result. replacing ( " \n " , with: " \n \t " ) ) "
104104 }
105105 return result
106106 }
@@ -114,7 +114,7 @@ extension DiagnosticTest {
114114 } else {
115115 var result = " Message: \( message) \n Fix-Its: \n "
116116 for fixIt in fixIts {
117- result += " \t \( fixIt. message) \n \t \( fixIt. result. _replacing ( " \n " , with: " \n \t " ) ) "
117+ result += " \t \( fixIt. message) \n \t \( fixIt. result. replacing ( " \n " , with: " \n \t " ) ) "
118118 }
119119 return result
120120 }
@@ -164,21 +164,9 @@ func AssertPredicateExpansion(_ source: String, _ result: String = "", diagnosti
164164 )
165165 AssertMacroExpansion (
166166 macros: [ " Expression " : FoundationMacros . ExpressionMacro. self] ,
167- source. _replacing ( " #Predicate " , with: " #Expression " ) ,
168- result. _replacing ( " .Predicate " , with: " .Expression " ) ,
167+ source. replacing ( " #Predicate " , with: " #Expression " ) ,
168+ result. replacing ( " .Predicate " , with: " .Expression " ) ,
169169 diagnostics: Set ( diagnostics. map ( \. mappedToExpression) ) ,
170170 sourceLocation: sourceLocation
171171 )
172172}
173-
174- extension String {
175- func _replacing( _ text: String , with other: String ) -> Self {
176- if #available( macOS 13 . 0 , * ) {
177- // Use the stdlib API if available
178- self . replacing ( text, with: other)
179- } else {
180- // Use the Foundation API on older OSes
181- self . replacingOccurrences ( of: text, with: other, options: [ . literal] )
182- }
183- }
184- }
0 commit comments