Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
7e784275
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7e784275
编写于
5月 08, 2021
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list, view scripts using new format
上级
ca4b06ff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
15 deletion
+28
-15
demo/sample/7_misc.php
demo/sample/7_misc.php
+5
-6
src/service/script/viewer.go
src/service/script/viewer.go
+17
-3
src/utils/zentao/zentao.go
src/utils/zentao/zentao.go
+1
-1
src/ztf.go
src/ztf.go
+5
-5
未找到文件。
demo/sample/7_misc.php
浏览文件 @
7e784275
...
...
@@ -12,18 +12,17 @@ pid=0
3. steps
step 3.1.1
step 3.1.2
[3.1. expects]
3.1. expects
[3.2. steps]
3.2. steps
step 3.2.1
step 3.2.2
[3.2. expects]
3.2. expects
expect 3.2.1
expect 3.2.2
[group]
4. step 4
5. step 5 >> expect 5
4. step 4
5. step 5 >> expect 5
*/
...
...
src/service/script/viewer.go
浏览文件 @
7e784275
...
...
@@ -4,8 +4,10 @@ import (
"fmt"
"github.com/easysoft/zentaoatf/src/model"
"github.com/easysoft/zentaoatf/src/utils/common"
constant
"github.com/easysoft/zentaoatf/src/utils/const"
"github.com/easysoft/zentaoatf/src/utils/file"
i118Utils
"github.com/easysoft/zentaoatf/src/utils/i118"
langUtils
"github.com/easysoft/zentaoatf/src/utils/lang"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
zentaoUtils
"github.com/easysoft/zentaoatf/src/utils/zentao"
"github.com/fatih/color"
...
...
@@ -120,14 +122,26 @@ func View(cases []string, keywords string) {
func
Brief
(
file
string
,
keywords
string
)
(
bool
,
[]
string
)
{
content
:=
fileUtils
.
ReadFile
(
file
)
lang
:=
langUtils
.
GetLangByFile
(
file
)
isOldFormat
:=
strings
.
Index
(
content
,
"[esac]"
)
>
-
1
myExp
:=
regexp
.
MustCompile
(
`\[case\][\S\s]*`
+
regStr
:=
""
if
isOldFormat
{
regStr
=
`\[case\][\S\s]*`
+
`title=([^\n]*)\n+`
+
`cid=([^\n]*)\n+`
+
`pid=([^\n]*)\n+`
+
`([\S\s]*)\n*`
+
`\[esac\]`
)
`\[esac\]`
}
else
{
regStr
=
fmt
.
Sprintf
(
`(?sm)%s[\S\s]*`
+
`title=([^\n]*)\n+`
+
`cid=([^\n]*)\n+`
+
`pid=([^\n]*)\n+`
+
`([\S\s]*)\n*%s`
,
constant
.
LangCommentsMap
[
lang
][
0
],
constant
.
LangCommentsMap
[
lang
][
1
])
}
myExp
:=
regexp
.
MustCompile
(
regStr
)
arr
:=
myExp
.
FindStringSubmatch
(
content
)
if
len
(
arr
)
>
2
{
...
...
src/utils/zentao/zentao.go
浏览文件 @
7e784275
...
...
@@ -83,7 +83,7 @@ func GetCaseInfo(file string) (bool, int, int, string) {
if
isOldFormat
{
regStr
=
`(?s)\[case\](.*)\[esac\]`
}
else
{
regStr
=
fmt
.
Sprintf
(
`(?
Us)%s
(.*)%s`
,
regStr
=
fmt
.
Sprintf
(
`(?
sm)%s((?U:.*pid.*))\n
(.*)%s`
,
constant
.
LangCommentsMap
[
lang
][
0
],
constant
.
LangCommentsMap
[
lang
][
1
])
}
myExp
:=
regexp
.
MustCompile
(
regStr
)
...
...
src/ztf.go
浏览文件 @
7e784275
...
...
@@ -140,11 +140,11 @@ func main() {
case
"set"
,
"-set"
:
action
.
Set
()
case
"sort"
,
"-sort"
:
files
:=
fileUtils
.
GetFilesFromParams
(
os
.
Args
[
2
:
])
if
err
:=
flagSet
.
Parse
(
os
.
Args
[
len
(
files
)
+
2
:
]);
err
==
nil
{
action
.
Sort
(
files
)
}
//
case "sort", "-sort":
//
files := fileUtils.GetFilesFromParams(os.Args[2:])
//
if err := flagSet.Parse(os.Args[len(files)+2:]); err == nil {
//
action.Sort(files)
//
}
case
"clean"
,
"-clean"
,
"-c"
:
action
.
Clean
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录