Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c8287056
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c8287056
编写于
11月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6672 URL 将 parseURL 按d.ts修改为静态函数并且修改测试用例 【monthly_20221018】
Merge pull request !6672 from zhangyouyou/cherry-pick-1669276093
上级
1eb2de1e
e12f8c4d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
26 addition
and
20 deletion
+26
-20
commonlibrary/ets_utils/url_lib_standard/src/main/js/test/url.test.js
...y/ets_utils/url_lib_standard/src/main/js/test/url.test.js
+26
-20
未找到文件。
commonlibrary/ets_utils/url_lib_standard/src/main/js/test/url.test.js
浏览文件 @
c8287056
...
@@ -3062,8 +3062,9 @@ describe('UrlFunTest', function () {
...
@@ -3062,8 +3062,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL001
'
,
0
,
function
()
{
it
(
'
testUrlparseURL001
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
})
...
@@ -3073,8 +3074,9 @@ describe('UrlFunTest', function () {
...
@@ -3073,8 +3074,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL002
'
,
0
,
function
()
{
it
(
'
testUrlparseURL002
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
flie:/developer.mozilla.org
'
)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
flie:/developer.mozilla.org
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
})
...
@@ -3084,8 +3086,9 @@ describe('UrlFunTest', function () {
...
@@ -3084,8 +3086,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL003
'
,
0
,
function
()
{
it
(
'
testUrlparseURL003
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
ftp://www.example.com
'
)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
ftp://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
})
...
@@ -3095,8 +3098,9 @@ describe('UrlFunTest', function () {
...
@@ -3095,8 +3098,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL004
'
,
0
,
function
()
{
it
(
'
testUrlparseURL004
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
'
,
'
http://www.example.com
'
)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
})
})
...
@@ -3106,8 +3110,9 @@ describe('UrlFunTest', function () {
...
@@ -3106,8 +3110,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL005
'
,
0
,
function
()
{
it
(
'
testUrlparseURL005
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
.
'
,
'
http://www.example.com
'
)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
.
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
})
})
...
@@ -3117,8 +3122,9 @@ describe('UrlFunTest', function () {
...
@@ -3117,8 +3122,9 @@ describe('UrlFunTest', function () {
*/
*/
it
(
'
testUrlparseURL006
'
,
0
,
function
()
{
it
(
'
testUrlparseURL006
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
../h:
'
,
'
http://www.example.com
'
)
expect
(
params
!=
null
).
assertTrue
()
var
result
=
params
.
href
let
params2
=
Url
.
URL
.
parseURL
(
'
../h:
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/h:
'
)
expect
(
result
).
assertEqual
(
'
http://www.example.com/h:
'
)
})
})
...
@@ -3129,9 +3135,9 @@ describe('UrlFunTest', function () {
...
@@ -3129,9 +3135,9 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL007
'
,
0
,
function
()
{
it
(
'
testUrlparseURL007
'
,
0
,
function
()
{
try
{
try
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
undefined
var
a
=
undefined
params
.
parseURL
(
a
)
Url
.
URL
.
parseURL
(
a
)
var
result
=
params
.
href
expect
(
0
).
assertEqual
(
1
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
...
@@ -3147,10 +3153,10 @@ describe('UrlFunTest', function () {
...
@@ -3147,10 +3153,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL008
'
,
0
,
function
()
{
it
(
'
testUrlparseURL008
'
,
0
,
function
()
{
try
{
try
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
666
;
var
a
=
666
;
var
b
=
666
;
var
b
=
666
;
params
.
parseURL
(
a
,
b
)
Url
.
URL
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
expect
(
0
).
assertEqual
(
1
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
...
@@ -3166,10 +3172,10 @@ describe('UrlFunTest', function () {
...
@@ -3166,10 +3172,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL009
'
,
0
,
function
()
{
it
(
'
testUrlparseURL009
'
,
0
,
function
()
{
try
{
try
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
'
666666
'
;
var
a
=
'
666666
'
;
var
b
=
666666
;
var
b
=
666666
;
params
.
parseURL
(
a
,
b
)
Url
.
URL
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
expect
(
0
).
assertEqual
(
1
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
b
}
must be string or URL`
);
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
b
}
must be string or URL`
);
...
@@ -3185,10 +3191,10 @@ describe('UrlFunTest', function () {
...
@@ -3185,10 +3191,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL0010
'
,
0
,
function
()
{
it
(
'
testUrlparseURL0010
'
,
0
,
function
()
{
try
{
try
{
let
params
=
new
Url
.
URL
()
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
'
666666
'
;
var
a
=
'
666666
'
;
var
b
=
"
666666
"
;
var
b
=
"
666666
"
;
params
.
parseURL
(
a
,
b
)
Url
.
URL
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
expect
(
0
).
assertEqual
(
1
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Syntax Error. Invalid Url string`
)
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Syntax Error. Invalid Url string`
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录