mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-08 19:52:57 +08:00
change: add unittests for parameters iterator unlimited mode
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
type TParamsConfig struct {
|
||||
Strategy iteratorStrategy `json:"strategy,omitempty" yaml:"strategy,omitempty"` // overall strategy
|
||||
Strategies map[string]iteratorStrategy `json:"strategies,omitempty" yaml:"strategies,omitempty"` // map[string]string、string
|
||||
Strategies map[string]iteratorStrategy `json:"strategies,omitempty" yaml:"strategies,omitempty"` // individual strategies for each parameters
|
||||
Limit int `json:"limit,omitempty" yaml:"limit,omitempty"`
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ type ParametersIterator struct {
|
||||
hasNext bool // cache query result
|
||||
sequentialParameters Parameters // cartesian product for sequential parameters
|
||||
randomParameterNames []string // value is parameter names
|
||||
limit int
|
||||
index int
|
||||
limit int // limit count for iteration
|
||||
index int // current iteration index
|
||||
}
|
||||
|
||||
// SetUnlimitedMode is used for load testing
|
||||
@@ -145,11 +145,6 @@ func (iter *ParametersIterator) Next() map[string]interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(iter.data) == 0 {
|
||||
iter.hasNext = false
|
||||
return nil
|
||||
}
|
||||
|
||||
var selectedParameters map[string]interface{}
|
||||
if len(iter.sequentialParameters) == 0 {
|
||||
selectedParameters = make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user