-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate ECS client to aws-sdk-go-v2 #4447
base: dev
Are you sure you want to change the base?
Changes from 1 commit
d763eee
d7f7a27
e64f752
99a016e
98226e0
bdce259
ac956e9
c3cc11b
bea4e89
5124bd9
b7ab4bb
76f9073
50f1c9a
c5bf057
447b0eb
443e1d5
029b479
6b5700a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,36 +83,28 @@ func TestUint16SliceToStringSlice(t *testing.T) { | |
stringSlice := Uint16SliceToStringSlice(tc.param) | ||
assert.Equal(t, tc.expected, len(stringSlice), tc.name) | ||
|
||
stringPtrSlice := Uint16SliceToStringPtrSlice(tc.param) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this unit test entirely, since the function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, will add it |
||
assert.Equal(t, tc.expected, len(stringPtrSlice), tc.name) | ||
|
||
for idx, num := range tc.param { | ||
reconverted, err := strconv.Atoi(stringSlice[idx]) | ||
assert.NoError(t, err) | ||
assert.Equal(t, num, uint16(reconverted)) | ||
|
||
assert.NotNil(t, stringPtrSlice[idx]) | ||
reconverted, err = strconv.Atoi(*stringPtrSlice[idx]) | ||
assert.NoError(t, err) | ||
assert.Equal(t, num, uint16(reconverted)) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestInt64PtrToIntPtr(t *testing.T) { | ||
func TestInt32PtrToIntPtr(t *testing.T) { | ||
testCases := []struct { | ||
input *int64 | ||
input *int32 | ||
expectedOutput *int | ||
name string | ||
}{ | ||
{nil, nil, "nil"}, | ||
{aws.Int64(2147483647), aws.Int(2147483647), "smallest max value type int can hold"}, | ||
{aws.Int32(2147483647), aws.Int(2147483647), "smallest max value type int can hold"}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
t.Run(tc.name, func(t *testing.T) { | ||
assert.Equal(t, tc.expectedOutput, Int64PtrToIntPtr(tc.input)) | ||
assert.Equal(t, tc.expectedOutput, Int32PtrToIntPtr(tc.input)) | ||
}) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Int32PtrToIntPtr converts a *int32 to *int.