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

fix bug#3448-3452

上级 4816fdca
title: 测试文件
desc:
author: zentao
version: 1.0
fields:
- field: test0
range: a-z # 字面常量及列表
postfix: "\t"
- field: field_recursive_test
fields:
- field: recursive.1
range: A-C
- field: recursive.2
range: 1-3
\ No newline at end of file
......@@ -89,6 +89,8 @@ func GetPrecision(base float64, step interface{}) (precision int, newStep float6
for i := 0; i < precision; i++ {
newStep = newStep / 10
}
} else {
newStep = step.(float64)
}
return
......
......@@ -66,6 +66,7 @@ func GenerateForDefinition(defaultFile, configFile string, fieldsToExport *[]str
func GenerateForField(field *model.DefField, withFix bool) (values []string) {
if len(field.Fields) > 0 { // sub fields
arrOfArr := make([][]string, 0) // 2 dimension arr for child, [ [a,b,c], [1,2,3] ]
for _, child := range field.Fields {
if child.From == "" {
child.From = field.From
......@@ -184,7 +185,7 @@ func GenerateFieldValuesForDef(field *model.DefField) []string {
count++
isRandomAndLoopEnd := !(*field).IsReferYaml && (*field).IsRand && (*field).LoopIndex == (*field).LoopEnd
// isNotRandomAndValOver := !(*field).IsRand && indexOfRow >= len(fieldWithValues.Values)
if count >= vari.Total || isRandomAndLoopEnd {
if count >= vari.Total || count >= len(fieldWithValues.Values) || isRandomAndLoopEnd {
break
}
......@@ -349,7 +350,8 @@ func putChildrenToArr(arrOfArr [][]string) (values [][]string) {
index = i % len(child)
}
strArr = append(strArr, child[index])
val := child[index]
strArr = append(strArr, val)
}
values = append(values, strArr)
......
title: 中文人名
title: 中文人名
desc:
author: zentao
version: 1.0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册