Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6d5fe9e5
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看板
提交
6d5fe9e5
编写于
11月 30, 2022
作者:
Z
zhangyouyou
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
https://gitee.com/openharmony/commonlibrary_ets_utils/issues/I63XDV?from=project-issue
Signed-off-by:
N
zhangyouyou
<
zhangyouyou2@huawei.com
>
上级
7449506e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
0 deletion
+56
-0
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
+56
-0
未找到文件。
commonlibrary/ets_utils/url_lib_standard/src/main/js/test/url.test.js
浏览文件 @
6d5fe9e5
...
...
@@ -2802,6 +2802,62 @@ describe('UrlFunTest', function () {
var
result
=
params
.
toString
()
expect
(
result
).
assertEqual
(
"
%E4%BD%A0%E5%A5%BD=china
"
)
})
/**
* @tc.name: testUrlURLParams001
* @tc.desc: Gets the SearchParams portion of the URL
*/
it
(
'
testUrlURLParams001
'
,
0
,
function
()
{
var
that
=
new
Url
.
URL
(
'
http://username:password@host:8080/directory/file?foo=1&bar=2
'
);
var
seach
=
that
.
params
var
result
=
seach
.
toString
()
expect
(
result
).
assertEqual
(
'
foo=1&bar=2
'
)
})
/**
* @tc.name: testUrlURLParams002
* @tc.desc: Gets the SearchParams portion of the URL
*/
it
(
'
testUrlURLParams002
'
,
0
,
function
()
{
let
that
=
new
Url
.
URL
(
'
https://example.com?foo=1&bar=2
'
)
let
seach
=
that
.
params
seach
.
append
(
"
ma 大
"
,
"
jk¥
"
)
var
result
=
seach
.
toString
()
expect
(
result
).
assertEqual
(
"
foo=1&bar=2&ma+%E5%A4%A7=jk%EF%BF%A5
"
)
})
/**
* @tc.name: testUrlURLParams003
* @tc.desc: Gets the SearchParams portion of the URL
*/
it
(
'
testUrlURLParams003
'
,
0
,
function
()
{
let
that
=
new
Url
.
URL
(
'
https://example.com?d=value1&c=value2&b=大&4=key4
'
)
let
seach
=
that
.
params
var
result
=
seach
.
toString
()
expect
(
result
).
assertEqual
(
"
d=value1&c=value2&b=%E5%A4%A7&4=key4
"
)
})
/**
* @tc.name: testUrlURLParams004
* @tc.desc: Gets the SearchParams portion of the URL
*/
it
(
'
testUrlURLParams004
'
,
0
,
function
()
{
let
that
=
new
Url
.
URL
(
'
https://example.com?foo=1&bar=2
'
)
let
seach
=
that
.
params
seach
.
append
(
"
foo~!@#$%^&*()_+-=
"
,
"
jk
"
)
var
result
=
seach
.
toString
()
expect
(
result
).
assertEqual
(
"
foo=1&bar=2&foo%7E%21%40%23%24%25%5E%26*%28%29_%2B-%3D=jk
"
)
})
/**
* @tc.name: testUrlURLParams005
* @tc.desc: Gets the SearchParams portion of the URL
*/
it
(
'
testUrlURLParams005
'
,
0
,
function
()
{
let
that
=
new
Url
.
URL
(
'
http://username:password@host:8080/directory/file?你好=china#qwer=da
'
)
let
seach
=
that
.
params
var
result
=
seach
.
toString
()
expect
(
result
).
assertEqual
(
"
%E4%BD%A0%E5%A5%BD=china
"
)
})
/**
* @tc.name: testUrlToJson001
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
999e6819
·
12月 24, 2022
mentioned in commit
999e6819
mentioned in commit 999e6819a4740225ed5b3e41685f9dfeead5abe4
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录