@@ -79,24 +79,16 @@ internal struct OptionsMacroIntegrationTests {
7979
8080 @Test internal func testCompleteOptionsMacroWorkflow( ) {
8181 // This test demonstrates the complete workflow that the Options macro would use
82+ // for an enum WITH raw values
8283
83- // Step 1: Determine if enum has raw values (simulated)
84- let hasRawValues = true
8584 let enumName = " TestEnum "
8685
87- // Step 2: Create the appropriate mappedValues variable
88- let mappedValuesVariable : Variable
89- if hasRawValues {
90- let keyValues : [ Int : String ] = [ 1 : " first " , 2 : " second " , 3 : " third " ]
91- mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: keyValues)
92- . withExplicitType ( ) . static ( )
93- } else {
94- let caseNames : [ String ] = [ " first " , " second " , " third " ]
95- mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: caseNames)
96- . withExplicitType ( ) . static ( )
97- }
98-
99- // Step 3: Create the extension
86+ // Create the mappedValues variable for enum with raw values
87+ let keyValues : [ Int : String ] = [ 1 : " first " , 2 : " second " , 3 : " third " ]
88+ let mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: keyValues)
89+ . withExplicitType ( ) . static ( )
90+
91+ // Create the extension
10092 let extensionDecl = Extension ( enumName) {
10193 TypeAlias ( " MappedType " , equals: " String " )
10294 mappedValuesVariable
@@ -117,19 +109,12 @@ internal struct OptionsMacroIntegrationTests {
117109 @Test internal func testOptionsMacroWorkflowWithoutRawValues( ) {
118110 // Test the workflow for enums without raw values
119111
120- let hasRawValues = false
121112 let enumName = " SimpleEnum "
122113
123- let mappedValuesVariable : Variable
124- if hasRawValues {
125- let keyValues : [ Int : String ] = [ 1 : " first " , 2 : " second " ]
126- mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: keyValues)
127- . withExplicitType ( ) . static ( )
128- } else {
129- let caseNames : [ String ] = [ " first " , " second " ]
130- mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: caseNames)
131- . withExplicitType ( ) . static ( )
132- }
114+ // Create the mappedValues variable for enum without raw values
115+ let caseNames : [ String ] = [ " first " , " second " ]
116+ let mappedValuesVariable = Variable ( . let, name: " mappedValues " , equals: caseNames)
117+ . withExplicitType ( ) . static ( )
133118
134119 let extensionDecl = Extension ( enumName) {
135120 TypeAlias ( " MappedType " , equals: " String " )
0 commit comments