There was an error while loading. Please reload this page.
1 parent 319e4b3 commit 81cc163Copy full SHA for 81cc163
events/attributevalue_test.go
@@ -211,6 +211,7 @@ func TestAccessWithWrongTypePanics(t *testing.T) {
211
}
212
213
for _, testCase := range testCases {
214
+testCase := testCase
215
var av DynamoDBAttributeValue
216
err := json.Unmarshal([]byte(testCase.input), &av)
217
assert.Nil(t, err)
events/chime_bot_test.go
@@ -4,10 +4,10 @@ package events
4
import (
5
"encoding/json"
6
"testing"
7
+"time"
8
9
"github.com/aws/aws-lambda-go/events/test"
10
"github.com/stretchr/testify/assert"
-"time"
11
)
12
13
func TestChimeBotEventMarshaling(t *testing.T) {
@@ -116,6 +116,7 @@ func TestChimeBotEventMarshaling(t *testing.T) {
116
117
118
for name, test := range tests {
119
+test := test
120
t.Run(name, func(t *testing.T) {
121
var testEvent ChimeBotEvent
122
if err := json.Unmarshal([]byte(test.inputJSON), &testEvent); err != nil {
events/cloudwatch_logs_test.go
@@ -25,6 +25,7 @@ func TestCloudwatchLogs(t *testing.T) {
25
},
26
27
} {
28
29
t.Run(test.name, func(t *testing.T) {
30
inputJson := tst.ReadJSONFromFile(t, test.eventJson)
31
@@ -71,6 +72,7 @@ func TestCloudwatchLogsParse(t *testing.T) {
71
72
73
74
75
76
77
78
events/code_commit_test.go
@@ -33,6 +33,7 @@ func TestCodeCommitReference(t *testing.T) {
33
34
35
for _, c := range cases {
36
+c := c
37
t.Run(c.Name, func(t *testing.T) {
38
test.AssertJsonBytes(t, c.Input, &CodeCommitReference{})
39
})
@@ -69,6 +70,7 @@ func TestCodeCommitCodeCommit(t *testing.T) {
69
70
test.AssertJsonBytes(t, c.Input, &CodeCommitCodeCommit{})
@@ -128,6 +130,7 @@ func TestCodeCommitRecord(t *testing.T) {
128
130
129
131
132
133
134
135
test.AssertJsonBytes(t, c.Input, &CodeCommitRecord{})
136
@@ -150,6 +153,7 @@ func TestCodeCommitEvent(t *testing.T) {
150
153
151
154
152
155
156
157
158
test.AssertJsonBytes(t, c.Input, &CodeCommitEvent{})
159
events/ses_test.go
@@ -19,6 +19,7 @@ func TestSESEventMarshaling(t *testing.T) {
19
20
21
for _, tc := range tests {
22
+tc := tc
23
t.Run(tc.file, func(t *testing.T) {
24
inputJSON := test.ReadJSONFromFile(t, tc.file)
lambda/handler_test.go
@@ -72,6 +72,7 @@ func TestInvalidHandlers(t *testing.T) {
for i, testCase := range testCases {
t.Run(fmt.Sprintf("testCase[%d] %s", i, testCase.name), func(t *testing.T) {
lambdaHandler := NewHandler(testCase.handler)
_, err := lambdaHandler.Invoke(context.TODO(), make([]byte, 0))
@@ -188,6 +189,7 @@ func TestInvokes(t *testing.T) {
188
189
190
191
192
193
194
195
response, err := lambdaHandler.Invoke(context.TODO(), []byte(testCase.input))
0 commit comments