提交 be73531a 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

support string constant

上级 6172b495
......@@ -82,6 +82,11 @@ func GenerateFieldValuesFromList(field *model.Field, fieldValue *model.FieldValu
items = GenerateFloatItems(startFloat, endFloat, step.(float64), rand)
} else if dataType == "char" {
items = GenerateByteItems(byte(startStr[0]), byte(endStr[0]), step, rand)
} else if dataType == "string" {
items = append(items, startStr)
if startStr != endStr {
items = append(items, endStr)
}
}
fieldValue.Values = append(fieldValue.Values, items...)
......@@ -203,5 +208,5 @@ func CheckRangeType(startStr string, endStr string, stepStr string) (string, int
}
}
return "", 0, 0, rand
return "string", 1, 0, false
}
\ No newline at end of file
......@@ -49,28 +49,29 @@ fields:
- name: field3.2
note: 从文件读数据
fields:
- name: domain
note: 字面常量
type: list
range: MY_,1-2
- name: domain
note: 域名,全局定义
type: custom
- name: custom_field
note: 从文件读定义
type: custom
range: custom.yaml
- name: domain
note: 域名,全局定义
type: custom
- name: field4
note: 引用。
type: list
range: ${user_name}${numb}@${domain}.com
expect: aaron@gmail.com
- name: user_name
note: 用户名
fields:
- name: first_name
type: custom
range: buildin.yaml
- name: last_name
type: custom
range: buildin.yaml
- name: numb
type: custom
range: custom.yaml
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册