Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1e90ebb8
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1e90ebb8
编写于
4月 11, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2975 add narrow param
Merge pull request !2975 from 杨清/1228
上级
b76bef72
0a1eacb5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
81 addition
and
13 deletion
+81
-13
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
...18n_standard/intljs/src/main/js/default/test/I18n.test.js
+16
-0
global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js
...18n_standard/intljs/src/main/js/default/test/Intl.test.js
+65
-13
未找到文件。
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
浏览文件 @
1e90ebb8
...
...
@@ -1625,6 +1625,22 @@ describe('I18nTest', function () {
'
en-US
'
,
'
medium
'
);
console
.
log
(
'
i18n_test_9200
'
+
value
);
expect
(
value
).
assertEqual
(
'
236.588 L
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_9250
* @tc.name test unitConvert interface from cup to liter unit with narrow style
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9250
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_9250
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
cup
'
,
measureSystem
:
'
US
'
},
{
unit
:
'
liter
'
,
measureSystem
:
'
SI
'
},
1000
,
'
en-US
'
,
'
narrow
'
);
console
.
log
(
'
i18n_test_9250
'
+
value
);
expect
(
value
).
assertEqual
(
'
236.588L
'
);
})
...
...
global/i18n_standard/intljs/src/main/js/default/test/Intl.test.js
浏览文件 @
1e90ebb8
...
...
@@ -1095,19 +1095,6 @@ describe('intlTest', function () {
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
+¥123,457
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2250
* @tc.name format the number with unitUsage
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2250
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
zh-CN
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
long
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2250
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
123,456.789米
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2100
* @tc.name format the number with signDisplay
...
...
@@ -1144,6 +1131,71 @@ describe('intlTest', function () {
expect
(
numfmt
.
resolvedOptions
().
unitDisplay
).
assertEqual
(
'
long
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2250
* @tc.name format the number with unitUsage
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2250
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
zh-CN
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
long
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2250
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
123,456.789米
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2260
* @tc.name format the number with narrow value in unitUsage param
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2260
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
zh-CN
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
narrow
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2260
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
123,456.789米
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2270
* @tc.name format the number with short value in unitUsage param
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2270
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
zh-CN
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
short
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2270
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
123,456.789米
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2280
* @tc.name format the number with narrow value in unitUsage param
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2280
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
en-US
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
narrow
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2280
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
76.712mi
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2290
* @tc.name format the number with short value in unitUsage param
* @tc.desc check the number with unitUsage
*/
it
(
'
formatNumber_test_2290
'
,
0
,
function
()
{
let
numfmt
=
new
Intl
.
NumberFormat
(
'
en-US
'
,
{
style
:
'
unit
'
,
unit
:
'
meter
'
,
unitDisplay
:
'
short
'
,
unitUsage
:
'
length-road
'
});
console
.
log
(
'
formatNumber_test_2290
'
+
numfmt
.
format
(
123456.789
));
expect
(
numfmt
.
format
(
123456.789
)).
assertEqual
(
'
76.712 mi
'
);
expect
(
numfmt
.
resolvedOptions
().
unitUsage
).
assertEqual
(
'
length-road
'
);
})
/* *
* @tc.number SUB_GLOBAL_INTL_JS_NUMBER_2300
* @tc.name format the number with percetn style
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录