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

fix some issues

上级 b99b6583
......@@ -2,10 +2,8 @@
/log/
/.idea/
/bin/
/test/
/xdoc/test/out/
/build/
/data/.cache/.data.db-shm
/data/.cache/.data.db-wal
/demo/out/
/zendata-test/
......@@ -5,8 +5,12 @@ version: 1.0
fields:
- field: field0
note: 基本属性
range: a-z
loop: 3
loopfix: ","
prefix: "'"
postfix: "'"
- field: field1
note: 引用同级目录中的yaml文件,取small和large两个分组的值
......
......@@ -102,7 +102,7 @@ func CheckRangeType(startStr string, endStr string, stepStr string) (string, int
var step interface{} = 1
if strings.ToLower(strings.TrimSpace(stepStr)) != "r" {
stepInt, errInt3 := strconv.Atoi(stepStr)
if errInt3 != nil {
if errInt3 == nil {
step = stepInt
}
} else {
......@@ -133,7 +133,7 @@ func CheckRangeType(startStr string, endStr string, stepStr string) (string, int
var step interface{} = 1
if strings.ToLower(strings.TrimSpace(stepStr)) != "r" {
stepChar, errChar3 := strconv.Atoi(stepStr)
if errChar3 != nil {
if errChar3 == nil {
step = stepChar
}
} else {
......
title: test
desc: This is a test file.
author: zentao
version: 1.0
fields:
- field: basic
note: 基本属性
range: a-z
loop: 3
loopfix: ","
prefix: "'"
postfix: "'"
- field: step
note: 指定步长
range: 1-10:2, 1-2:0.1
loop: 3
loopfix: ","
prefix: "'"
postfix: "'"
- field: random
note: R属性指定随机
range: 1-10:R
loop: 6
loopfix: ","
prefix: "'"
postfix: "'"
\ No newline at end of file
title: test
desc: This is a test file.
author: zentao
version: 1.0
fields:
- field: refer
from: system.ip.v1.yaml
use: privateC
prefix: "'"
postfix: "'"
loop: 3
loopfix: " "
- field: excel
from: system.address.v1.city
select: name
where: state like '%山东%'
prefix: "'"
postfix: "'"
loop: 3
loopfix: " "
\ No newline at end of file
>> Usage:
>> 3
>> 'a,b,c'
>> output.txt
>> '1,3,5'
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=basic
cid=0
pid=0
[group]
1. usage output >>
2. basic output >>
3. step output >>
[esac]
*/
$output = [];
exec('./zd-mac -h', $output);
print(">> $output[0]\n");
$output = [];
exec('./zd-mac -y ../test/definition/basic.yaml -c 3 -field basic -o ../test/output/output.txt -f text', $output);
$count = sprintf("%d", count($output));
print(">> $count\n");
print(">> $output[0]\n");
$output = [];
exec('ls ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
$output = [];
exec('./zd-mac -y ../test/definition/basic.yaml -c 7 -field step -o ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=query excel
cid=0
pid=0
[group]
1. usage output >>
2. basic output >>
3. step output >>
[esac]
*/
$output = [];
exec('../build/zd-mac -h', $output);
print(">> $output[0]\n");
$output = [];
exec('../build/zd-mac -y definition/basic.yaml -c 15 -field field1 -o test/output.txt -f text', $output);
print(">> $output[0]\n");
$output = [];
exec('../build/zd-mac -y definition/basic.yaml -c 15 -field field2 -o test/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=random
cid=0
pid=0
[group]
1. usage output >>
2. basic output >>
3. step output >>
[esac]
*/
$output = [];
exec('../build/zd-mac -h', $output);
print(">> $output[0]\n");
$output = [];
exec('../build/zd-mac -y definition/basic.yaml -c 15 -field field1 -o test/output.txt -f text', $output);
print(">> $output[0]\n");
$output = [];
exec('../build/zd-mac -y definition/basic.yaml -c 15 -field field2 -o test/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=reference
cid=0
pid=0
[group]
1. output >>
[esac]
*/
$output = [];
exec('../build/zd-mac -y definition/refer.yaml -c 3 -field refer -o test/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册