Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2ddc8027
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看板
提交
2ddc8027
编写于
11月 24, 2022
作者:
Z
zhangyouyou
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
https://gitee.com/openharmony/commonlibrary_ets_utils/issues/I62SXY
Signed-off-by:
N
zhangyouyou
<
zhangyouyou2@huawei.com
>
上级
9fff85af
变更
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
浏览文件 @
2ddc8027
...
...
@@ -3062,8 +3062,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL001
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
...
...
@@ -3073,8 +3074,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL002
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
flie:/developer.mozilla.org
'
)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
flie:/developer.mozilla.org
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
...
...
@@ -3084,8 +3086,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL003
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
ftp://www.example.com
'
)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
https://developer.mozilla.org
'
,
'
ftp://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
https://developer.mozilla.org/
'
)
})
...
...
@@ -3095,8 +3098,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL004
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
'
,
'
http://www.example.com
'
)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
})
...
...
@@ -3106,8 +3110,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL005
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
.
'
,
'
http://www.example.com
'
)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
.
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/
'
)
})
...
...
@@ -3117,8 +3122,9 @@ describe('UrlFunTest', function () {
*/
it
(
'
testUrlparseURL006
'
,
0
,
function
()
{
let
params
=
new
Url
.
URL
()
params
.
parseURL
(
'
../h:
'
,
'
http://www.example.com
'
)
var
result
=
params
.
href
expect
(
params
!=
null
).
assertTrue
()
let
params2
=
Url
.
URL
.
parseURL
(
'
../h:
'
,
'
http://www.example.com
'
)
var
result
=
params2
.
href
expect
(
result
).
assertEqual
(
'
http://www.example.com/h:
'
)
})
...
...
@@ -3129,9 +3135,9 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL007
'
,
0
,
function
()
{
try
{
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
undefined
params
.
parseURL
(
a
)
var
result
=
params
.
href
Url
.
URL
.
parseURL
(
a
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
...
...
@@ -3147,10 +3153,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL008
'
,
0
,
function
()
{
try
{
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
666
;
var
b
=
666
;
params
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
Url
.
URL
.
parseURL
(
a
,
b
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
a
}
must be string`
)
...
...
@@ -3166,10 +3172,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL009
'
,
0
,
function
()
{
try
{
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
'
666666
'
;
var
b
=
666666
;
params
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
Url
.
URL
.
parseURL
(
a
,
b
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Parameter error.The type of
${
b
}
must be string or URL`
);
...
...
@@ -3185,10 +3191,10 @@ describe('UrlFunTest', function () {
it
(
'
testUrlparseURL0010
'
,
0
,
function
()
{
try
{
let
params
=
new
Url
.
URL
()
expect
(
params
!=
null
).
assertTrue
()
var
a
=
'
666666
'
;
var
b
=
"
666666
"
;
params
.
parseURL
(
a
,
b
)
var
result
=
params
.
href
Url
.
URL
.
parseURL
(
a
,
b
)
expect
(
0
).
assertEqual
(
1
)
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
`BusinessError: Syntax Error. Invalid Url string`
)
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
e12f8c4d
·
11月 26, 2022
mentioned in commit
e12f8c4d
mentioned in commit e12f8c4d27599cb0340db19632d56166f02aa4be
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录