Skip to content

Commit ed4695d

Browse files
committed
Update set_sdk_whitebox_test.go
1 parent 7003dbb commit ed4695d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

pkg/generate/code/set_sdk_whitebox_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func TestSetSDKForScalar(t *testing.T) {
4747
Shape: &awssdkmodel.Shape{
4848
Type: "string",
4949
},
50+
OriginalMemberName: "BucketName",
5051
},
5152
indentLevel: 1,
5253
expected: "\tres.BucketName = ko.Spec.Name\n",
@@ -63,6 +64,7 @@ func TestSetSDKForScalar(t *testing.T) {
6364
Shape: &awssdkmodel.Shape{
6465
Type: "boolean",
6566
},
67+
OriginalMemberName: "Enabled",
6668
},
6769
indentLevel: 1,
6870
expected: "\tres.Enabled = ko.Spec.Enabled\n",
@@ -79,14 +81,15 @@ func TestSetSDKForScalar(t *testing.T) {
7981
Shape: &awssdkmodel.Shape{
8082
Type: "integer",
8183
},
84+
OriginalMemberName: "MaxKeys",
8285
},
8386
indentLevel: 1,
84-
expected: ` Copy0 := *ko.Spec.MaxKeys
85-
if Copy0 > math.MaxInt32 || Copy0 < math.MinInt32 {
86-
return nil, fmt.Errorf("error: field is of type int32")
87+
expected: ` maxKeysCopy0 := *ko.Spec.MaxKeys
88+
if maxKeysCopy0 > math.MaxInt32 || maxKeysCopy0 < math.MinInt32 {
89+
return nil, fmt.Errorf("error: field MaxKeys is of type int32")
8790
}
88-
Copy := int32(Copy0)
89-
res.MaxKeys = &Copy
91+
maxKeysCopy := int32(maxKeysCopy0)
92+
res.MaxKeys = &maxKeysCopy
9093
`,
9194
},
9295
{
@@ -101,14 +104,15 @@ func TestSetSDKForScalar(t *testing.T) {
101104
Shape: &awssdkmodel.Shape{
102105
Type: "float",
103106
},
107+
OriginalMemberName: "Temperature",
104108
},
105109
indentLevel: 1,
106-
expected: ` Copy0 := *ko.Spec.Temperature
107-
if Copy0 > math.MaxFloat32 || Copy0 < -math.MaxFloat32 || (Copy0 < math.SmallestNonzeroFloat32 && !(Copy0 <= 0)) || (Copy0 > -math.SmallestNonzeroFloat32 && !(Copy0 >= 0)) {
108-
return nil, fmt.Errorf("error: field is of type float32")
110+
expected: ` temperatureCopy0 := *ko.Spec.Temperature
111+
if temperatureCopy0 > math.MaxFloat32 || temperatureCopy0 < -math.MaxFloat32 || (temperatureCopy0 < math.SmallestNonzeroFloat32 && !(temperatureCopy0 <= 0)) || (temperatureCopy0 > -math.SmallestNonzeroFloat32 && !(temperatureCopy0 >= 0)) {
112+
return nil, fmt.Errorf("error: field Temperature is of type float32")
109113
}
110-
Copy := float32(Copy0)
111-
res.Temperature = &Copy
114+
temperatureCopy := float32(temperatureCopy0)
115+
res.Temperature = &temperatureCopy
112116
`,
113117
},
114118
}

0 commit comments

Comments
 (0)