File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,42 @@ func TestInt32ToFramework(t *testing.T) {
161
161
}
162
162
}
163
163
164
+ func TestInt32ToFrameworkLegacy (t * testing.T ) {
165
+ t .Parallel ()
166
+
167
+ type testCase struct {
168
+ input * int32
169
+ expected types.Int64
170
+ }
171
+ tests := map [string ]testCase {
172
+ "valid int64" : {
173
+ input : aws .Int32 (42 ),
174
+ expected : types .Int64Value (42 ),
175
+ },
176
+ "zero int64" : {
177
+ input : aws .Int32 (0 ),
178
+ expected : types .Int64Value (0 ),
179
+ },
180
+ "nil int64" : {
181
+ input : nil ,
182
+ expected : types .Int64Value (0 ),
183
+ },
184
+ }
185
+
186
+ for name , test := range tests {
187
+ name , test := name , test
188
+ t .Run (name , func (t * testing.T ) {
189
+ t .Parallel ()
190
+
191
+ got := flex .Int32ToFrameworkLegacy (context .Background (), test .input )
192
+
193
+ if diff := cmp .Diff (got , test .expected ); diff != "" {
194
+ t .Errorf ("unexpected diff (+wanted, -got): %s" , diff )
195
+ }
196
+ })
197
+ }
198
+ }
199
+
164
200
func TestInt32FromFramework (t * testing.T ) {
165
201
t .Parallel ()
166
202
You can’t perform that action at this time.
0 commit comments