Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a00c1ab
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看板
未验证
提交
9a00c1ab
编写于
4月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8480 Add test cases for the create function
Merge pull request !8480 from jwx1068251/master
上级
07959b42
7d3e33d0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
17 deletion
+37
-17
commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js
...ts_utils/util2_lib_standard/src/main/js/test/util.test.js
+37
-17
未找到文件。
commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js
浏览文件 @
9a00c1ab
...
...
@@ -4562,60 +4562,80 @@ describe('Base64HelperTest', function () {
describe
(
'
DecodeEncodeTest
'
,
function
()
{
/**
* @tc.name: test
encoding_textdecoder_
001
* @tc.name: test
TextDecoderCreate
001
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_
001
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-8
'
,
{
ignoreBOM
:
true
})
it
(
'
test
TextDecoderCreate
001
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-8
'
,
{
ignoreBOM
:
true
})
var
retStr
=
that
.
encoding
expect
(
retStr
).
assertEqual
(
'
utf-8
'
)
})
/**
* @tc.name: test
encoding_textdecoder_
002
* @tc.name: test
TextDecoderCreate
002
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_
002
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreate
002
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16le
'
)
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-16le
'
)
})
/**
* @tc.name: test
encoding_textdecoder_
003
* @tc.name: test
TextDecoderCreate
003
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_
003
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreate
003
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16be
'
)
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-16be
'
)
})
/**
* @tc.name: test
encoding_textdecoder_
004
* @tc.name: test
TextDecoderCreate
004
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_
004
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreate
004
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16be
'
,
{
ignoreBOM
:
true
})
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-16be
'
)
})
/**
* @tc.name: test
encoding_textdecoder_
005
* @tc.name: test
TextDecoderCreate
005
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_
005
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreate
005
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16be
'
,
{
ignoreBOM
:
false
})
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-16be
'
)
})
/**
* @tc.name: test
encoding_textdecoder_ThrowError_001
* @tc.name: test
TextDecoderCreate006
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
testencoding_textdecoder_ThrowError_001
'
,
0
,
function
()
{
it
(
'
testTextDecoderCreate006
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
()
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-8
'
)
})
/**
* @tc.name: testTextDecoderCreate007
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
testTextDecoderCreate007
'
,
0
,
function
()
{
var
that
=
util
.
TextDecoder
.
create
({
ignoreBOM
:
false
})
var
encodingStr
=
that
.
encoding
expect
(
encodingStr
).
assertEqual
(
'
utf-8
'
)
})
/**
* @tc.name: testTextDecoderCreateThrowError001
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
testTextDecoderCreateThrowError001
'
,
0
,
function
()
{
try
{
var
that
=
util
.
TextDecoder
.
create
(
123
,
{
ignoreBOM
:
false
})
var
encodingStr
=
that
.
encoding
...
...
@@ -4626,10 +4646,10 @@ describe('DecodeEncodeTest', function () {
})
/**
* @tc.name: test
encoding_textdecoder_ThrowError_
002
* @tc.name: test
TextDecoderCreateThrowError
002
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_ThrowError_
002
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreateThrowError
002
'
,
0
,
function
()
{
try
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16be
'
,
'
ignoreBOM
'
)
var
encodingStr
=
that
.
encoding
...
...
@@ -4640,10 +4660,10 @@ describe('DecodeEncodeTest', function () {
})
/**
* @tc.name: test
encoding_textdecoder_ThrowError_
003
* @tc.name: test
TextDecoderCreateThrowError
003
* @tc.desc: The source encoding's name, lowercased.
*/
it
(
'
test
encoding_textdecoder_ThrowError_
003
'
,
0
,
function
()
{
it
(
'
test
TextDecoderCreateThrowError
003
'
,
0
,
function
()
{
try
{
var
that
=
util
.
TextDecoder
.
create
(
'
utf-16be
'
,
123
)
var
encodingStr
=
that
.
encoding
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录