File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func TestLoadAndParseOverrideLimits(t *testing.T) {
120
120
// Burst cannot be 0.
121
121
_ , err = loadAndParseOverrideLimits ("testdata/busted_override_burst_0.yml" )
122
122
test .AssertError (t , err , "single override limit with burst=0" )
123
- test .Assert (t , ! os . IsNotExist ( err ), "test file should exist " )
123
+ test .AssertContains (t , err . Error ( ), "invalid burst " )
124
124
125
125
// Id cannot be empty.
126
126
_ , err = loadAndParseOverrideLimits ("testdata/busted_override_empty_id.yml" )
@@ -179,7 +179,7 @@ func TestLoadAndParseDefaultLimits(t *testing.T) {
179
179
// Burst cannot be 0.
180
180
_ , err = loadAndParseDefaultLimits ("testdata/busted_default_burst_0.yml" )
181
181
test .AssertError (t , err , "single default limit with burst=0" )
182
- test .Assert (t , ! os . IsNotExist ( err ), "test file should exist " )
182
+ test .AssertContains (t , err . Error ( ), "invalid burst " )
183
183
184
184
// Name cannot be empty.
185
185
_ , err = loadAndParseDefaultLimits ("testdata/busted_default_empty_name.yml" )
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ var stringToName = func() map[string]Name {
251
251
252
252
// limitNames is a slice of all rate limit names.
253
253
var limitNames = func () []string {
254
- names := make ([]string , len (nameToString ))
254
+ names := make ([]string , 0 , len (nameToString ))
255
255
for _ , v := range nameToString {
256
256
names = append (names , v )
257
257
}
You can’t perform that action at this time.
0 commit comments