@@ -52,7 +52,7 @@ public struct TestFunctionName: Equatable, RawRepresentable {
5252 public var rawValue : String {
5353 return Self . testPrefix +
5454 nameApplying( pathComponentTransform: Self . functionEncodedName)
55- . replacingOccurrences ( of: " . " , with: " \( Self . periodReplacementCharacter ) " )
55+ . replacingOccurrences ( of: " . " , with: " \( Self . moduleSeparatorPeriodReplacementCharacter ) " )
5656 }
5757
5858 /// The fully qualified test function name is the name of the test
@@ -83,7 +83,7 @@ public struct TestFunctionName: Equatable, RawRepresentable {
8383
8484 let value = rawValue [ rangeOfPrefix. upperBound... ]
8585
86- var components = value. split ( separator: Self . periodReplacementCharacter )
86+ var components = value. split ( separator: Self . moduleSeparatorPeriodReplacementCharacter )
8787
8888 guard components. count > 2 else {
8989 return nil
@@ -130,21 +130,25 @@ public struct TestFunctionName: Equatable, RawRepresentable {
130130 . replacingOccurrences ( of: " { " , with: " \( Self . openBraceReplacementCharacter) " )
131131 . replacingOccurrences ( of: " } " , with: " \( Self . closeBraceReplacementCharacter) " )
132132 . replacingOccurrences ( of: " " , with: " \( Self . spaceReplacementCharacter) " )
133+ . replacingOccurrences ( of: " . " , with: " \( Self . namePeriodReplacementCharacter) " )
133134 }
134135
135136 internal static func functionDecodedName( from string: String ) -> String {
136137 return string
137138 . replacingOccurrences ( of: " \( Self . openBraceReplacementCharacter) " , with: " { " )
138139 . replacingOccurrences ( of: " \( Self . closeBraceReplacementCharacter) " , with: " } " )
139140 . replacingOccurrences ( of: " \( Self . spaceReplacementCharacter) " , with: " " )
141+ . replacingOccurrences ( of: " \( Self . namePeriodReplacementCharacter) " , with: " . " )
140142 }
141143
142- /// For swift names, we remove braces, escape reserved words, and convert spaces to underscores.
144+ /// For swift names, we remove braces, escape reserved words, and convert
145+ /// spaces and periods to underscores.
143146 public static func swiftName( from string: String ) -> String {
144147 let name = string
145148 . replacingOccurrences ( of: " { " , with: " " )
146149 . replacingOccurrences ( of: " } " , with: " " )
147150 . replacingOccurrences ( of: " " , with: " _ " )
151+ . replacingOccurrences ( of: " . " , with: " _ " )
148152 return Self . escapedKeyword ( name)
149153 }
150154
@@ -160,7 +164,8 @@ public struct TestFunctionName: Equatable, RawRepresentable {
160164 private static var openBraceReplacementCharacter : Character = " ➊ "
161165 private static var closeBraceReplacementCharacter : Character = " ➋ "
162166 private static var spaceReplacementCharacter : Character = " ➌ "
163- private static var periodReplacementCharacter : Character = " ➍ "
167+ private static var moduleSeparatorPeriodReplacementCharacter : Character = " ➍ "
168+ private static var namePeriodReplacementCharacter : Character = " ❺ "
164169 // ➎ taken by `TestFunctionLocalContext.prefixSeparatorCharacter`.
165170}
166171
0 commit comments