Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
zendata
提交
5ec8a716
Z
zendata
项目概览
LinuxSuRen
/
zendata
与 Fork 源项目一致
Fork自
易企天创 / zendata
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5ec8a716
编写于
8月 05, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test scripts to check i118
上级
da190781
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
116 addition
and
10 deletion
+116
-10
.gitignore
.gitignore
+1
-0
test/unit/test-mod.go
test/unit/test-mod.go
+41
-0
test/unit/test-server.go
test/unit/test-server.go
+20
-0
test/ztf/conf/zdata.conf
test/ztf/conf/zdata.conf
+2
-0
test/ztf/script/command/cmd_example.exp
test/ztf/script/command/cmd_example.exp
+4
-2
test/ztf/script/command/cmd_example.php
test/ztf/script/command/cmd_example.php
+10
-0
test/ztf/script/command/cmd_usage.exp
test/ztf/script/command/cmd_usage.exp
+4
-1
test/ztf/script/command/cmd_usage.php
test/ztf/script/command/cmd_usage.php
+13
-1
test/ztf/script/common/zd.php
test/ztf/script/common/zd.php
+21
-6
未找到文件。
.gitignore
浏览文件 @
5ec8a716
...
...
@@ -7,3 +7,4 @@
/conf/
/bin/
/test/ztf/output/
/test/ztf/.idea/
test/unit/test-mod.go
0 → 100644
浏览文件 @
5ec8a716
package
main
import
(
"fmt"
"strconv"
)
func
main
()
{
arrOfArr
:=
[
3
][]
string
{}
arrOfArr
[
0
]
=
[]
string
{
"a"
,
"b"
,
"c"
,
"d"
,
"e"
}
arrOfArr
[
1
]
=
[]
string
{
"1"
,
"2"
}
arrOfArr
[
2
]
=
[]
string
{
"X"
,
"Y"
,
"Z"
}
indexArr
:=
make
([]
int
,
0
)
for
_
,
_
=
range
arrOfArr
{
indexArr
=
append
(
indexArr
,
0
)
}
for
i
:=
0
;
i
<
len
(
arrOfArr
);
i
++
{
loop
:=
1
for
j
:=
i
+
1
;
j
<
len
(
arrOfArr
);
j
++
{
loop
=
loop
*
len
(
arrOfArr
[
j
])
}
indexArr
[
i
]
=
loop
}
for
i
:=
0
;
i
<
100
;
i
++
{
str
:=
strconv
.
Itoa
(
i
)
+
": "
for
j
:=
0
;
j
<
len
(
arrOfArr
);
j
++
{
child
:=
arrOfArr
[
j
]
mod
:=
indexArr
[
j
]
remainder
:=
i
/
mod
%
len
(
child
)
str
=
str
+
child
[
remainder
]
}
fmt
.
Println
(
str
)
//addCur(&indexArr, arrOfArr)
}
}
\ No newline at end of file
test/unit/test-server.go
0 → 100644
浏览文件 @
5ec8a716
package
main
import
(
fileUtils
"github.com/easysoft/zendata/src/utils/file"
httpUtils
"github.com/easysoft/zendata/src/utils/http"
"net/url"
)
func
main
()
{
urlStr
:=
httpUtils
.
GenUrl
(
"10.8.0.134"
,
8848
,
"?config=&F=field_common&lines=10"
)
data
:=
url
.
Values
{}
defaultContent
:=
fileUtils
.
ReadFile
(
"demo/default.yaml"
)
configContent
:=
fileUtils
.
ReadFile
(
"demo/test.yaml"
)
data
.
Add
(
"default"
,
defaultContent
)
data
.
Add
(
"config"
,
configContent
)
httpUtils
.
PostForm
(
urlStr
,
data
)
}
\ No newline at end of file
test/ztf/conf/zdata.conf
0 → 100644
浏览文件 @
5ec8a716
Version
=
1
Language
=
zh
\ No newline at end of file
test/ztf/script/command/cmd_example.exp
浏览文件 @
5ec8a716
>> `%s zendata config %s`
>> `%s zendata config %s`
\ No newline at end of file
>> zendata config
>> zendata config
>> zendata数据
>> zendata数据
\ No newline at end of file
test/ztf/script/command/cmd_example.php
浏览文件 @
5ec8a716
...
...
@@ -9,6 +9,8 @@ pid=0
[group]
>>
>>
>>
>>
[esac]
*/
...
...
@@ -17,8 +19,16 @@ include_once __DIR__ . DIRECTORY_SEPARATOR . '../common/zd.php';
$zd
=
new
zendata
();
$zd
->
changeLang
(
"en"
);
$output
=
$zd
->
cmd
(
"-e"
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-example"
);
print
(
">>
$output[0]
\n
"
);
$zd
->
changeLang
(
"zh"
);
$output
=
$zd
->
cmd
(
"-e"
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-example"
);
print
(
">>
$output[0]
\n
"
);
\ No newline at end of file
test/ztf/script/command/cmd_usage.exp
浏览文件 @
5ec8a716
>> `ZenData is %s`
>> `ZenData is %s`
>> `ZenData is %s`
\ No newline at end of file
>> `ZenData is %s`
>> ZenData是一款
>> ZenData是一款
>> ZenData是一款
\ No newline at end of file
test/ztf/script/command/cmd_usage.php
浏览文件 @
5ec8a716
...
...
@@ -10,6 +10,9 @@ pid=0
>>
>>
>>
>>
>>
>>
[esac]
*/
...
...
@@ -18,11 +21,20 @@ include_once __DIR__ . DIRECTORY_SEPARATOR . '../common/zd.php';
$zd
=
new
zendata
();
$zd
->
changeLang
(
"en"
);
$output
=
$zd
->
cmd
(
""
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-h"
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-help"
);
print
(
">>
$output[0]
\n
"
);
$zd
->
changeLang
(
"zh"
);
$output
=
$zd
->
cmd
(
""
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-h"
);
print
(
">>
$output[0]
\n
"
);
$output
=
$zd
->
cmd
(
"-help"
);
print
(
">>
$output[0]
\n
"
);
\ No newline at end of file
test/ztf/script/common/zd.php
浏览文件 @
5ec8a716
...
...
@@ -15,9 +15,10 @@ class zendata
$this
->
workDir
=
$config
[
'zd'
][
'workDir'
];
}
public
function
c
md
(
$params
)
public
function
c
reate
(
$default
,
$conf
,
$lines
,
$output
,
$options
=
array
()
)
{
$cmdStr
=
sprintf
(
"%s %s"
,
$this
->
cmdPath
,
$params
);
$cmdStr
=
sprintf
(
"%s -c %s/%s -n %d -F %s"
,
$this
->
cmdPath
,
$this
->
workDir
,
$conf
,
$lines
,
$options
[
"fields"
]);
print
(
"
$cmdStr
\n
"
);
$output
=
[];
...
...
@@ -25,10 +26,13 @@ class zendata
return
$output
;
}
public
function
create
(
$default
,
$conf
,
$lines
,
$output
,
$options
=
array
()
)
public
function
parse
(
$config
,
$input
)
{
$cmdStr
=
sprintf
(
"%s -c %s/%s -n %d -F %s"
,
$this
->
cmdPath
,
$this
->
workDir
,
$conf
,
$lines
,
$options
[
"fields"
]);
}
public
function
cmd
(
$params
)
{
$cmdStr
=
sprintf
(
"%s %s"
,
$this
->
cmdPath
,
$params
);
print
(
"
$cmdStr
\n
"
);
$output
=
[];
...
...
@@ -36,7 +40,18 @@ class zendata
return
$output
;
}
public
function
parse
(
$config
,
$input
)
public
function
changeLang
(
$lang
)
{
$filename
=
''
;
$filename
=
sprintf
(
"conf/zdata.conf"
);
$content
=
file_get_contents
(
$filename
);
$fp
=
fopen
(
$filename
,
"w"
);
$content
=
str_replace
(
"en"
,
$lang
,
$content
);
$content
=
str_replace
(
"zh"
,
$lang
,
$content
);
fwrite
(
$fp
,
$content
);
fclose
(
$fp
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录