File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -236,3 +236,43 @@ func TestInt32FromFramework(t *testing.T) {
236
236
})
237
237
}
238
238
}
239
+
240
+ func TestInt32FromFrameworkLegacy (t * testing.T ) {
241
+ t .Parallel ()
242
+
243
+ type testCase struct {
244
+ input types.Int64
245
+ expected * int32
246
+ }
247
+ tests := map [string ]testCase {
248
+ "valid int64" : {
249
+ input : types .Int64Value (42 ),
250
+ expected : aws .Int32 (42 ),
251
+ },
252
+ "zero int64" : {
253
+ input : types .Int64Value (0 ),
254
+ expected : nil ,
255
+ },
256
+ "null int64" : {
257
+ input : types .Int64Null (),
258
+ expected : nil ,
259
+ },
260
+ "unknown int64" : {
261
+ input : types .Int64Unknown (),
262
+ expected : nil ,
263
+ },
264
+ }
265
+
266
+ for name , test := range tests {
267
+ name , test := name , test
268
+ t .Run (name , func (t * testing.T ) {
269
+ t .Parallel ()
270
+
271
+ got := flex .Int32FromFrameworkLegacy (context .Background (), test .input )
272
+
273
+ if diff := cmp .Diff (got , test .expected ); diff != "" {
274
+ t .Errorf ("unexpected diff (+wanted, -got): %s" , diff )
275
+ }
276
+ })
277
+ }
278
+ }
You can’t perform that action at this time.
0 commit comments