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

test Chinese with awesome-gocui/gocui fork

上级 524691b3
@echo off @echo off
goto start goto start
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1[0-9]{10} 2. regular expression match >> 1[0-9]{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
:start :start
echo ^>^> hello echo ^>^> hello
echo ^>^> 13905120512 echo ^>^> 13905120512
echo ^>^> abc123 echo ^>^> abc123
\ No newline at end of file
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
goto start goto start
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
:start :start
...@@ -21,4 +20,4 @@ for /f "delims=" %%a in ('curl -s "http://pms.zentao.net/user-login.html" ^| fi ...@@ -21,4 +20,4 @@ for /f "delims=" %%a in ('curl -s "http://pms.zentao.net/user-login.html" ^| fi
for /f "tokens=2 delims='" %%i in ("!var!") do ( for /f "tokens=2 delims='" %%i in ("!var!") do (
set var2=%%~i set var2=%%~i
) )
echo ^>^> !var2! echo ^>^> !var2!
\ No newline at end of file
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
goto start goto start
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Validate its format >> ^[a-z0-9]{26} 3. Validate its format >> ^[a-z0-9]{26}
[esac] [esac]
:start :start
......
#!/usr/bin/env node #!/usr/bin/env node
/** /**
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1\d{10} 2. regular expression match >> 1\d{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
*/ */
...@@ -18,4 +17,4 @@ pid=0 ...@@ -18,4 +17,4 @@ pid=0
console.log(">> hello"); console.log(">> hello");
console.log(">> 13905120512"); console.log(">> 13905120512");
console.log(">> abc123"); console.log(">> abc123");
\ No newline at end of file
#!/usr/bin/env node #!/usr/bin/env node
/** /**
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
*/ */
...@@ -30,4 +29,4 @@ http.get('http://pms.zentao.net/user-login.html', function(req) { ...@@ -30,4 +29,4 @@ http.get('http://pms.zentao.net/user-login.html', function(req) {
console.log(">>" + res[1]) console.log(">>" + res[1])
}); });
}); });
\ No newline at end of file
#!/usr/bin/env node #!/usr/bin/env node
/** /**
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Validate its format >> ^[a-z0-9]{26} 3. Validate its format >> ^[a-z0-9]{26}
[esac] [esac]
*/ */
...@@ -32,4 +31,4 @@ http.get('http://pms.zentao.net/?mode=getconfig', function(req) { ...@@ -32,4 +31,4 @@ http.get('http://pms.zentao.net/?mode=getconfig', function(req) {
} }
} }
}); });
}); });
\ No newline at end of file
#!/usr/bin/env lua #!/usr/bin/env lua
--[[ --[[
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1\d{10} 2. regular expression match >> 1\d{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
]] ]]
print(">> hello"); print(">> hello");
print(">> 13905120512"); print(">> 13905120512");
print(">> abc123"); print(">> abc123");
\ No newline at end of file
#!/usr/bin/env lua #!/usr/bin/env lua
--[[ --[[
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
]] ]]
...@@ -31,4 +30,4 @@ if c~= 200 then ...@@ -31,4 +30,4 @@ if c~= 200 then
else else
_, _, src = string.find(body, "<img%ssrc='(.-)' .*>") _, _, src = string.find(body, "<img%ssrc='(.-)' .*>")
print(">>" .. src) print(">>" .. src)
end end
\ No newline at end of file
#!/usr/bin/env lua #!/usr/bin/env lua
--[[ --[[
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Check its format >> ^[a-z0-9]{26} 3. Check its format >> ^[a-z0-9]{26}
[esac] [esac]
]] ]]
......
#!/usr/bin/env perl #!/usr/bin/env perl
=pod =pod
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1\d{10} 2. regular expression match >> 1\d{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
=cut =cut
print ">> hello\n"; print ">> hello\n";
print ">> 13905120512\n"; print ">> 13905120512\n";
print ">> abc123\n"; print ">> abc123\n";
\ No newline at end of file
#!/usr/bin/env perl #!/usr/bin/env perl
=pod =pod
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
=cut =cut
...@@ -19,4 +18,4 @@ $html = get('http://pms.zentao.net/user-login.html'); ...@@ -19,4 +18,4 @@ $html = get('http://pms.zentao.net/user-login.html');
if ( $html =~ /<img src='(.*?)' .*>/ ) { if ( $html =~ /<img src='(.*?)' .*>/ ) {
print ">> $1\n"; print ">> $1\n";
} }
\ No newline at end of file
#!/usr/bin/env perl #!/usr/bin/env perl
=pod =pod
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Check its format >> ^[a-z0-9]{26} 3. Check its format >> ^[a-z0-9]{26}
[esac] [esac]
=cut =cut
...@@ -19,4 +18,4 @@ $json = get('http://pms.zentao.net/?mode=getconfig'); ...@@ -19,4 +18,4 @@ $json = get('http://pms.zentao.net/?mode=getconfig');
if ( $json =~ /"sessionID":"([^"]*)"/ ) { if ( $json =~ /"sessionID":"([^"]*)"/ ) {
print ">> $1\n"; print ">> $1\n";
} }
\ No newline at end of file
#!/usr/bin/env ruby #!/usr/bin/env ruby
=begin =begin
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1\d{10} 2. regular expression match >> 1\d{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
=end =end
print(">> hello\n"); print(">> hello\n");
print(">> 13905120512\n"); print(">> 13905120512\n");
print(">> abc123\n"); print(">> abc123\n");
\ No newline at end of file
#!/usr/bin/env ruby #!/usr/bin/env ruby
=begin =begin
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
=end =end
...@@ -23,4 +22,4 @@ open(uri) do |http| ...@@ -23,4 +22,4 @@ open(uri) do |http|
end end
elem = html.match(/<img src='(.*?)' .*>/).captures elem = html.match(/<img src='(.*?)' .*>/).captures
puts '>> ' + elem[0] puts '>> ' + elem[0]
\ No newline at end of file
#!/usr/bin/env ruby #!/usr/bin/env ruby
=begin =begin
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Check its format >> ^[a-z0-9]{26} 3. Check its format >> ^[a-z0-9]{26}
[esac] [esac]
=end =end
...@@ -24,4 +23,4 @@ open(uri) do |http| ...@@ -24,4 +23,4 @@ open(uri) do |http|
end end
json = JSON.parse(html) # need json library (gem install json) json = JSON.parse(html) # need json library (gem install json)
puts '>> ' + json['sessionID'] puts '>> ' + json['sessionID']
\ No newline at end of file
#!/usr/bin/env tclsh #!/usr/bin/env tclsh
set case { set case {
[case] [case]
title=check string matches pattern title=check string matches pattern
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. exactly match >> hello 1. exactly match >> hello
2. regular expression match >> 1\d{10} 2. regular expression match >> 1\d{10}
3. format string match >> %s%d 3. format string match >> %s%d
[esac] [esac]
} }
puts ">> hello" puts ">> hello"
puts ">> 13905120512" puts ">> 13905120512"
puts ">> abc123" puts ">> abc123"
\ No newline at end of file
#!/usr/bin/env tclsh #!/usr/bin/env tclsh
set case { set case {
[case] [case]
title=extract content from webpage title=extract content from webpage
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Load web page from url http://xxx 1. Load web page from url http://xxx
2. Retrieve img element zt-logo.png in html 2. Retrieve img element zt-logo.png in html
3. Check img exist >> .*zt-logo.png 3. Check img exist >> .*zt-logo.png
[esac] [esac]
} }
...@@ -22,4 +21,4 @@ set http [::http::geturl $url] ...@@ -22,4 +21,4 @@ set http [::http::geturl $url]
set html [::http::data $http] set html [::http::data $http]
regexp -- {<img src='(.*?)' .*>} $html match elem regexp -- {<img src='(.*?)' .*>} $html match elem
puts ">> $elem" puts ">> $elem"
\ No newline at end of file
#!/usr/bin/env tclsh #!/usr/bin/env tclsh
set case { set case {
[case] [case]
title=check remote interface response title=check remote interface response
cid=0 cid=0
pid=0 pid=0
[group] [group]
1. Send a request to interface http://xxx 1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json 2. Retrieve sessionID field from response json
3. Check its format >> ^[a-z0-9]{26} 3. Check its format >> ^[a-z0-9]{26}
[esac] [esac]
} }
...@@ -24,4 +23,4 @@ set jsonStr [::http::data $http] ...@@ -24,4 +23,4 @@ set jsonStr [::http::data $http]
# need json library, you may use ActiveTcl # need json library, you may use ActiveTcl
set jsonObj [json::json2dict $jsonStr] set jsonObj [json::json2dict $jsonStr]
puts ">> [dict get $jsonObj sessionID]" puts ">> [dict get $jsonObj sessionID]"
\ No newline at end of file
...@@ -125,7 +125,7 @@ func runCases(files []string) { ...@@ -125,7 +125,7 @@ func runCases(files []string) {
ext = ext[1:] ext = ext[1:]
} }
lang := vari.ScriptExtToNameMap[ext] lang := vari.ScriptExtToNameMap[ext]
if commonUtils.GetFieldVal(conf, stringUtils.Ucfirst(lang)) == "" { // filter by interpreter if lang != "bat" && commonUtils.GetFieldVal(conf, stringUtils.Ucfirst(lang)) == "" { // filter by interpreter
continue continue
} }
} else if !commonUtils.IsWin() { // filter by os } else if !commonUtils.IsWin() { // filter by os
......
...@@ -15,6 +15,10 @@ import ( ...@@ -15,6 +15,10 @@ import (
) )
func Report(report model.TestReport, pathMaxWidth int) { func Report(report model.TestReport, pathMaxWidth int) {
if len(report.Cases) == 0 {
return
}
// print failed case // print failed case
failedCount := 0 failedCount := 0
failedCaseLines := make([]string, 0) failedCaseLines := make([]string, 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册