@@ -43,7 +43,7 @@ struct SpecializationTests {
4343 public var name: String
4444 }
4545
46- public struct Pet {
46+ public struct Tool {
4747 public var name: String
4848 }
4949
@@ -52,7 +52,7 @@ struct SpecializationTests {
5252 }
5353
5454 public typealias FishBox = Box<Fish>
55- public typealias PetBox = Box<Pet >
55+ public typealias ToolBox = Box<Tool >
5656 """#
5757
5858 // ==== -----------------------------------------------------------------------
@@ -67,7 +67,7 @@ struct SpecializationTests {
6767
6868 // Both specialized types should be registered
6969 #expect( translator. importedTypes [ " FishBox " ] != nil , " FishBox should be in importedTypes " )
70- #expect( translator. importedTypes [ " PetBox " ] != nil , " PetBox should be in importedTypes" )
70+ #expect( translator. importedTypes [ " ToolBox " ] != nil , " ToolBox should be in importedTypes" )
7171
7272 // The base generic type remains in importedTypes (not removed)
7373 let baseBox = try #require( translator. importedTypes [ " Box " ] )
@@ -78,16 +78,16 @@ struct SpecializationTests {
7878
7979 // Specialized types link back to their base
8080 let fishBox = try #require( translator. importedTypes [ " FishBox " ] )
81- let petBox = try #require( translator. importedTypes [ " PetBox " ] )
81+ let toolBox = try #require( translator. importedTypes [ " ToolBox " ] )
8282 #expect( fishBox. isSpecialization)
83- #expect( petBox . isSpecialization)
83+ #expect( toolBox . isSpecialization)
8484
8585 // Verify effective names are distinct
8686 #expect( fishBox. effectiveJavaName == " FishBox " )
87- #expect( petBox . effectiveJavaName == " PetBox " )
87+ #expect( toolBox . effectiveJavaName == " ToolBox " )
8888
8989 #expect( fishBox. effectiveSwiftTypeName == " Box<Fish> " )
90- #expect( petBox . effectiveSwiftTypeName == " Box<Pet > " )
90+ #expect( toolBox . effectiveSwiftTypeName == " Box<Tool > " )
9191
9292 // Verify new generic-model properties
9393 #expect( fishBox. genericParameterNames == [ " Element " ] )
@@ -96,14 +96,14 @@ struct SpecializationTests {
9696 #expect( fishBox. baseTypeName == " Box " )
9797 #expect( fishBox. specializedTypeName == " FishBox " )
9898
99- #expect( petBox . genericParameterNames == [ " Element " ] )
100- #expect( petBox . genericArguments == [ " Element " : " Pet " ] )
101- #expect( petBox . isFullySpecialized)
102- #expect( petBox . baseTypeName == " Box " )
103- #expect( petBox . specializedTypeName == " PetBox " )
99+ #expect( toolBox . genericParameterNames == [ " Element " ] )
100+ #expect( toolBox . genericArguments == [ " Element " : " Tool " ] )
101+ #expect( toolBox . isFullySpecialized)
102+ #expect( toolBox . baseTypeName == " Box " )
103+ #expect( toolBox . specializedTypeName == " ToolBox " )
104104
105105 // Both wrappers delegate to the same base type
106- #expect( fishBox. specializationBaseType === petBox . specializationBaseType, " Both should wrap the same base Box type " )
106+ #expect( fishBox. specializationBaseType === toolBox . specializationBaseType, " Both should wrap the same base Box type " )
107107 #expect( fishBox. specializationBaseType === translator. importedTypes [ " Box " ] , " Base should be the original Box " )
108108 }
109109
@@ -119,7 +119,7 @@ struct SpecializationTests {
119119 #expect( specializations. count == 2 , " Should have exactly 2 specializations for Box " )
120120
121121 let javaNames = specializations. map ( \. effectiveJavaName) . sorted ( )
122- #expect( javaNames == [ " FishBox " , " PetBox " ] )
122+ #expect( javaNames == [ " FishBox " , " ToolBox " ] )
123123 }
124124
125125 // ==== -----------------------------------------------------------------------
@@ -151,29 +151,29 @@ struct SpecializationTests {
151151 )
152152 }
153153
154- @Test ( " PetBox Java class has base methods but not Fish-constrained methods" )
155- func petBoxJavaClass ( ) throws {
154+ @Test ( " ToolBox Java class has base methods but not Fish-constrained methods" )
155+ func toolBoxJavaClass ( ) throws {
156156 try assertOutput (
157157 input: multiSpecializationInput,
158158 . jni,
159159 . java,
160160 detectChunkByInitialLines: 1 ,
161161 expectedChunks: [
162162 // Class declaration
163- " public final class PetBox implements JNISwiftInstance { " ,
163+ " public final class ToolBox implements JNISwiftInstance { " ,
164164 // Base method from Box<Element>
165165 " public long count() " ,
166166 ] ,
167167 )
168168
169- // Verify observeTheFish does NOT appear inside PetBox 's class body
169+ // Verify observeTheFish does NOT appear inside ToolBox 's class body
170170 var config = Configuration ( )
171171 config. swiftModule = " SwiftModule "
172172 let translator = Swift2JavaTranslator ( config: config)
173173 try translator. analyze ( path: " /fake/Fake.swiftinterface " , text: multiSpecializationInput)
174- let petBox = try #require( translator. importedTypes [ " PetBox " ] )
175- let methodNames = petBox . methods. map ( \. name)
176- #expect( !methodNames. contains ( " observeTheFish " ) , " PetBox should not have Fish-constrained method" )
174+ let toolBox = try #require( translator. importedTypes [ " ToolBox " ] )
175+ let methodNames = toolBox . methods. map ( \. name)
176+ #expect( !methodNames. contains ( " observeTheFish " ) , " ToolBox should not have Fish-constrained method" )
177177 }
178178
179179 @Test ( " Single specialization generates expected Java class " )
0 commit comments