Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c47928b9
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看板
提交
c47928b9
编写于
3月 19, 2022
作者:
Y
y00314596
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
6752a971
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
243 addition
and
171 deletion
+243
-171
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
...18n_standard/intljs/src/main/js/default/test/I18n.test.js
+234
-169
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
...18n_standard/intljs/src/main/js/default/test/Lang.test.js
+9
-2
未找到文件。
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
浏览文件 @
c47928b9
...
...
@@ -161,6 +161,20 @@ describe('I18nTest', function () {
expect
(
lang
).
assertEqual
(
'
aa
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_0850
* @tc.name setSystemLanguage with not exist param aaa
* @tc.desc check the language
*/
it
(
'
SUB_GLOBAL_I18N_JS_0850
'
,
0
,
function
()
{
let
value
=
I18n
.
setSystemLanguage
(
'
aaa
'
);
console
.
log
(
'
SUB_GLOBAL_I18N_JS_0850
'
+
value
);
expect
(
value
).
assertTrue
();
let
lang
=
I18n
.
getSystemLanguage
();
console
.
log
(
'
SUB_GLOBAL_I18N_JS_0850
'
+
lang
);
expect
(
lang
).
assertEqual
(
'
aaa
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_0900
* @tc.name setSystemLanguage with not exist param aabb
...
...
@@ -242,6 +256,29 @@ describe('I18nTest', function () {
expect
(
value
).
assertTrue
();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_1420
* @tc.name setSystemRegion with ACN param
* @tc.desc check the region
*/
it
(
'
i18n_test_1420
'
,
0
,
function
()
{
let
value
=
I18n
.
setSystemRegion
(
'
ACN
'
);
console
.
log
(
'
i18n_test_1420
'
+
value
);
expect
(
value
).
assertFalse
();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_1440
* @tc.name setSystemRegion with cn param
* @tc.desc check the region
*/
it
(
'
i18n_test_1440
'
,
0
,
function
()
{
let
value
=
I18n
.
setSystemRegion
(
'
cn
'
);
console
.
log
(
'
i18n_test_1440
'
+
value
);
expect
(
value
).
assertFalse
();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_1500
* @tc.name setSystemRegion with zh-CN param
...
...
@@ -723,27 +760,55 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5100
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5100
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5100
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5100
'
+
ran
);
console
.
log
(
'
i18n_test_5100
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_5100
'
+
valid
);
console
.
log
(
'
i18n_test_5100
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_5120
* @tc.name test isValidNumber interface with 0755-6100088X param
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5120
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_5120
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_5120
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
0755-6100088
'
+
ran
);
console
.
log
(
'
i18n_test_5120
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_5140
* @tc.name test isValidNumber interface with 110 param
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5140
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_5140
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
valid
=
phonenumber
.
isValidNumber
(
'
110
'
);
console
.
log
(
'
i18n_test_5140
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_5200
* @tc.name test isValidNumber interface with 135 1057 4676 param
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5200
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5200
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5200
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5200
'
+
ran
);
console
.
log
(
'
i18n_test_5200
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
135 1057 467
'
+
ran
);
console
.
error
(
'
i18n_test_5200
'
+
valid
);
console
.
log
(
'
i18n_test_5200
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -753,12 +818,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5300
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5300
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5300
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5300
'
+
ran
);
console
.
log
(
'
i18n_test_5300
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
+86 135 1057 467
'
+
ran
);
console
.
error
(
'
i18n_test_5300
'
+
valid
);
console
.
log
(
'
i18n_test_5300
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -768,12 +833,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5400
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5400
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5400
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5400
'
+
ran
);
console
.
log
(
'
i18n_test_5400
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
135-1057-467
'
+
ran
);
console
.
error
(
'
i18n_test_5400
'
+
valid
);
console
.
log
(
'
i18n_test_5400
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -783,12 +848,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5500
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5500
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5500
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5500
'
+
ran
);
console
.
log
(
'
i18n_test_5500
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
tel:+86-135-1057-467
'
+
ran
);
console
.
error
(
'
i18n_test_5500
'
+
valid
);
console
.
log
(
'
i18n_test_5500
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -798,12 +863,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5600
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5600
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5600
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5600
'
+
ran
);
console
.
log
(
'
i18n_test_5600
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
86-135-1057-467
'
+
ran
);
console
.
error
(
'
i18n_test_5600
'
+
valid
);
console
.
log
(
'
i18n_test_5600
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -813,12 +878,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5700
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5700
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5700
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5700
'
+
ran
);
console
.
log
(
'
i18n_test_5700
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
+861351057467
'
+
ran
);
console
.
error
(
'
i18n_test_5700
'
+
valid
);
console
.
log
(
'
i18n_test_5700
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -828,12 +893,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5800
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5800
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5800
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5800
'
+
ran
);
console
.
log
(
'
i18n_test_5800
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
861351057467
'
+
ran
);
console
.
error
(
'
i18n_test_5800
'
+
valid
);
console
.
log
(
'
i18n_test_5800
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -843,12 +908,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_5900
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_5900
'
+
'
start
'
);
console
.
log
(
'
i18n_test_5900
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_5900
'
+
ran
);
console
.
log
(
'
i18n_test_5900
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
135105746
'
+
ran
);
console
.
error
(
'
i18n_test_5900
'
+
valid
);
console
.
log
(
'
i18n_test_5900
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -858,12 +923,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6000
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6000
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6000
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6000
'
+
ran
);
console
.
log
(
'
i18n_test_6000
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
13510574676
'
+
ran
);
console
.
error
(
'
i18n_test_6000
'
+
valid
);
console
.
log
(
'
i18n_test_6000
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -873,12 +938,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6100
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6100
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6100
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6100
'
+
ran
);
console
.
log
(
'
i18n_test_6100
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
135105746
'
+
ran
+
'
a
'
);
console
.
error
(
'
i18n_test_6100
'
+
valid
);
console
.
log
(
'
i18n_test_6100
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -888,12 +953,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6200
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6200
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6200
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6200
'
+
ran
);
console
.
log
(
'
i18n_test_6200
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_6200
'
+
valid
);
console
.
log
(
'
i18n_test_6200
'
+
valid
);
expect
(
valid
).
assertEqual
(
true
);
})
...
...
@@ -903,12 +968,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6300
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6300
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6300
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6300
'
+
ran
);
console
.
log
(
'
i18n_test_6300
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
62620233
'
+
ran
);
console
.
error
(
'
i18n_test_6300
'
+
valid
);
console
.
log
(
'
i18n_test_6300
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -918,12 +983,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6400
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6400
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6400
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6400
'
+
ran
);
console
.
log
(
'
i18n_test_6400
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
6262023379
'
+
ran
);
console
.
error
(
'
i18n_test_6400
'
+
valid
);
console
.
log
(
'
i18n_test_6400
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -933,12 +998,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6500
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6500
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6500
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6500
'
+
ran
);
console
.
log
(
'
i18n_test_6500
'
+
ran
);
let
valid
=
phonenumber
.
isValidNumber
(
'
62620233
'
+
ran
+
'
a
'
);
console
.
error
(
'
i18n_test_6500
'
+
valid
);
console
.
log
(
'
i18n_test_6500
'
+
valid
);
expect
(
valid
).
assertEqual
(
false
);
})
...
...
@@ -948,13 +1013,13 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6600
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6600
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6600
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6600
'
+
ran
);
console
.
log
(
'
i18n_test_6600
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_6600
'
+
value
);
expect
(
value
).
assertEqual
(
'
135 1057 467
6
'
);
console
.
log
(
'
i18n_test_6600
'
+
value
);
expect
(
value
).
assertEqual
(
'
135 1057 467
'
+
ran
);
})
/**
...
...
@@ -963,12 +1028,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6700
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6700
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6700
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6700
'
+
ran
);
console
.
log
(
'
i18n_test_6700
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_6700
'
+
value
);
console
.
log
(
'
i18n_test_6700
'
+
value
);
expect
(
value
).
assertEqual
(
'
(626) 202-337
'
+
ran
);
})
...
...
@@ -978,12 +1043,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6800
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6800
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6800
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
NATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6800
'
+
ran
);
console
.
log
(
'
i18n_test_6800
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_6800
'
+
value
);
console
.
log
(
'
i18n_test_6800
'
+
value
);
expect
(
value
).
assertEqual
(
'
135 1057 467
'
+
ran
);
})
...
...
@@ -993,12 +1058,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_6900
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_6900
'
+
'
start
'
);
console
.
log
(
'
i18n_test_6900
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
NATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_6900
'
+
ran
);
console
.
log
(
'
i18n_test_6900
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
135105746
'
+
ran
);
console
.
error
(
'
i18n_test_6900
'
+
value
);
console
.
log
(
'
i18n_test_6900
'
+
value
);
expect
(
value
).
assertEqual
(
'
135105746
'
+
ran
);
})
...
...
@@ -1008,12 +1073,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7000
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7000
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7000
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
NATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7000
'
+
ran
);
console
.
log
(
'
i18n_test_7000
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
13510574676
'
+
ran
);
console
.
error
(
'
i18n_test_7000
'
+
value
);
console
.
log
(
'
i18n_test_7000
'
+
value
);
expect
(
value
).
assertEqual
(
'
013 510 574 676
'
+
ran
);
})
...
...
@@ -1023,12 +1088,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7100
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7100
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7100
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
NATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7100
'
+
ran
);
console
.
log
(
'
i18n_test_7100
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
135 1057 467
'
+
ran
);
console
.
error
(
'
i18n_test_7100
'
+
value
);
console
.
log
(
'
i18n_test_7100
'
+
value
);
expect
(
value
).
assertEqual
(
'
135 1057 467
'
+
ran
);
})
...
...
@@ -1038,12 +1103,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7200
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7200
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7200
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
INTERNATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7200
'
+
ran
);
console
.
log
(
'
i18n_test_7200
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_7200
'
+
value
);
console
.
log
(
'
i18n_test_7200
'
+
value
);
expect
(
value
).
assertEqual
(
'
+86 135 1057 467
'
+
ran
);
})
...
...
@@ -1053,12 +1118,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7300
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7300
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7300
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
RFC3966
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7300
'
+
ran
);
console
.
log
(
'
i18n_test_7300
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_7300
'
+
value
);
console
.
log
(
'
i18n_test_7300
'
+
value
);
expect
(
value
).
assertEqual
(
'
tel:+86-135-1057-467
'
+
ran
);
})
...
...
@@ -1068,12 +1133,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7400
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7400
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7400
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
,
{
'
type
'
:
'
E164
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7400
'
+
ran
);
console
.
log
(
'
i18n_test_7400
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
1351057467
'
+
ran
);
console
.
error
(
'
i18n_test_7400
'
+
value
);
console
.
log
(
'
i18n_test_7400
'
+
value
);
expect
(
value
).
assertEqual
(
'
+861351057467
'
+
ran
);
})
...
...
@@ -1083,12 +1148,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7500
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7500
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7500
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
,
{
'
type
'
:
'
NATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7500
'
+
ran
);
console
.
log
(
'
i18n_test_7500
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_7500
'
+
value
);
console
.
log
(
'
i18n_test_7500
'
+
value
);
expect
(
value
).
assertEqual
(
'
(626) 202-337
'
+
ran
);
})
...
...
@@ -1098,12 +1163,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7600
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7600
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7600
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
,
{
'
type
'
:
'
INTERNATIONAL
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7600
'
+
ran
);
console
.
log
(
'
i18n_test_7600
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_7600
'
+
value
);
console
.
log
(
'
i18n_test_7600
'
+
value
);
expect
(
value
).
assertEqual
(
'
+1 626-202-337
'
+
ran
);
})
...
...
@@ -1113,12 +1178,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7700
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7700
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7700
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
,
{
'
type
'
:
'
RFC3966
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7700
'
+
ran
);
console
.
log
(
'
i18n_test_7700
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_7700
'
+
value
);
console
.
log
(
'
i18n_test_7700
'
+
value
);
expect
(
value
).
assertEqual
(
'
tel:+1-626-202-337
'
+
ran
);
})
...
...
@@ -1128,12 +1193,12 @@ describe('I18nTest', function () {
* @tc.desc get the isValidNumber value
*/
it
(
'
i18n_test_7800
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7800
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7800
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
US
'
,
{
'
type
'
:
'
E164
'
});
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
error
(
'
i18n_test_7800
'
+
ran
);
console
.
log
(
'
i18n_test_7800
'
+
ran
);
let
value
=
phonenumber
.
format
(
'
626202337
'
+
ran
);
console
.
error
(
'
i18n_test_7800
'
+
value
);
console
.
log
(
'
i18n_test_7800
'
+
value
);
expect
(
value
).
assertEqual
(
'
+1626202337
'
+
ran
);
})
...
...
@@ -1143,10 +1208,10 @@ describe('I18nTest', function () {
* @tc.desc get the isWeekend value
*/
it
(
'
i18n_test_7900
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7900
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7900
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
value
=
calendar
.
isWeekend
(
new
Date
(
2021
,
10
,
1
,
10
,
0
,
0
,
0
));
console
.
error
(
'
i18n_test_7900
'
+
value
);
console
.
log
(
'
i18n_test_7900
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1156,22 +1221,22 @@ describe('I18nTest', function () {
* @tc.desc get the getCalendar value
*/
it
(
'
i18n_test_7920
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7920
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7920
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
ja
'
,
'
japanese
'
);
let
name
=
calendar
.
getDisplayName
(
'
ja
'
);
console
.
error
(
'
i18n_test_7920
'
+
name
);
console
.
log
(
'
i18n_test_7920
'
+
name
);
expect
(
name
).
assertEqual
(
'
和暦
'
);
let
timezone
=
calendar
.
getTimeZone
();
console
.
error
(
'
i18n_test_7920
'
+
timezone
);
console
.
log
(
'
i18n_test_7920
'
+
timezone
);
expect
(
timezone
).
assertEqual
(
'
Coordinated Universal Time
'
);
let
firstday
=
calendar
.
getFirstDayOfWeek
();
console
.
error
(
'
i18n_test_7920
'
+
firstday
);
console
.
log
(
'
i18n_test_7920
'
+
firstday
);
expect
(
firstday
).
assertEqual
(
1
);
let
miniday
=
calendar
.
getMinimalDaysInFirstWeek
();
console
.
error
(
'
i18n_test_7920
'
+
miniday
);
console
.
log
(
'
i18n_test_7920
'
+
miniday
);
expect
(
miniday
).
assertEqual
(
1
);
let
value
=
calendar
.
isWeekend
(
new
Date
(
2022
,
10
,
1
,
10
,
0
,
0
,
0
));
console
.
error
(
'
i18n_test_7920
'
+
value
);
console
.
log
(
'
i18n_test_7920
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1181,10 +1246,10 @@ describe('I18nTest', function () {
* @tc.desc get the getCalendar value
*/
it
(
'
i18n_test_7940
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7940
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7940
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
,
'
chinese
'
);
let
name
=
calendar
.
getDisplayName
(
'
zh
'
);
console
.
error
(
'
i18n_test_7940
'
+
name
);
console
.
log
(
'
i18n_test_7940
'
+
name
);
expect
(
name
).
assertEqual
(
'
农历
'
);
})
...
...
@@ -1194,10 +1259,10 @@ describe('I18nTest', function () {
* @tc.desc get the getCalendar value
*/
it
(
'
i18n_test_7960
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_7960
'
+
'
start
'
);
console
.
log
(
'
i18n_test_7960
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
,
'
japanese
'
);
let
name
=
calendar
.
getDisplayName
(
'
zh
'
);
console
.
error
(
'
i18n_test_7960
'
+
name
);
console
.
log
(
'
i18n_test_7960
'
+
name
);
expect
(
name
).
assertEqual
(
'
和历
'
);
})
...
...
@@ -1207,10 +1272,10 @@ describe('I18nTest', function () {
* @tc.desc get the getDisplayName value
*/
it
(
'
i18n_test_8000
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8000
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8000
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
value
=
calendar
.
getDisplayName
(
'
zh
'
);
console
.
error
(
'
i18n_test_8000
'
+
value
);
console
.
log
(
'
i18n_test_8000
'
+
value
);
expect
(
value
).
assertEqual
(
'
公历
'
);
})
...
...
@@ -1220,10 +1285,10 @@ describe('I18nTest', function () {
* @tc.desc get the getDisplayName value
*/
it
(
'
i18n_test_8020
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8020
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8020
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
value
=
calendar
.
getDisplayName
(
'
en
'
);
console
.
error
(
'
i18n_test_8020
'
+
value
);
console
.
log
(
'
i18n_test_8020
'
+
value
);
expect
(
value
).
assertEqual
(
'
Gregorian Calendar
'
);
})
...
...
@@ -1233,10 +1298,10 @@ describe('I18nTest', function () {
* @tc.desc get the get value
*/
it
(
'
i18n_test_8100
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8100
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8100
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
value
=
calendar
.
get
(
'
year
'
);
console
.
error
(
'
i18n_test_8100
'
+
value
);
console
.
log
(
'
i18n_test_8100
'
+
value
);
expect
(
value
).
assertLarger
(
0
);
})
...
...
@@ -1246,12 +1311,12 @@ describe('I18nTest', function () {
* @tc.desc get the get value
*/
it
(
'
i18n_test_8120
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8120
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8120
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
date1
=
new
Date
(
2021
,
8
,
8
,
8
,
8
,
8
,
8
);
calendar
.
setTime
(
date1
);
let
value
=
calendar
.
get
(
'
month
'
);
console
.
error
(
'
i18n_test_8120
'
+
value
);
console
.
log
(
'
i18n_test_8120
'
+
value
);
expect
(
value
).
assertEqual
(
8
);
})
...
...
@@ -1261,10 +1326,10 @@ describe('I18nTest', function () {
* @tc.desc get the get value
*/
it
(
'
i18n_test_8140
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8140
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8140
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
value
=
calendar
.
get
(
'
day_of_year
'
);
console
.
error
(
'
i18n_test_8140
'
+
value
);
console
.
log
(
'
i18n_test_8140
'
+
value
);
expect
(
value
).
assertLarger
(
0
);
})
...
...
@@ -1274,11 +1339,11 @@ describe('I18nTest', function () {
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
*/
it
(
'
i18n_test_8200
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8200
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8200
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setMinimalDaysInFirstWeek
(
1
);
let
value
=
calendar
.
getMinimalDaysInFirstWeek
();
console
.
error
(
'
i18n_test_8200
'
+
value
);
console
.
log
(
'
i18n_test_8200
'
+
value
);
expect
(
value
).
assertEqual
(
1
);
})
...
...
@@ -1288,11 +1353,11 @@ describe('I18nTest', function () {
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
*/
it
(
'
i18n_test_8220
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8220
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8220
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setMinimalDaysInFirstWeek
(
0
);
let
value
=
calendar
.
getMinimalDaysInFirstWeek
();
console
.
error
(
'
i18n_test_8220
'
+
value
);
console
.
log
(
'
i18n_test_8220
'
+
value
);
expect
(
value
).
assertEqual
(
1
);
})
...
...
@@ -1302,11 +1367,11 @@ describe('I18nTest', function () {
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
*/
it
(
'
i18n_test_8240
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8240
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8240
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setMinimalDaysInFirstWeek
(
8
);
let
value
=
calendar
.
getMinimalDaysInFirstWeek
();
console
.
error
(
'
i18n_test_8240
'
+
value
);
console
.
log
(
'
i18n_test_8240
'
+
value
);
expect
(
value
).
assertEqual
(
7
);
})
...
...
@@ -1316,11 +1381,11 @@ describe('I18nTest', function () {
* @tc.desc get the setMinimalDaysInFirstWeek and getMinimalDaysInFirstWeek value
*/
it
(
'
i18n_test_8260
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8260
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8260
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setMinimalDaysInFirstWeek
(
7
);
let
value
=
calendar
.
getMinimalDaysInFirstWeek
();
console
.
error
(
'
i18n_test_8260
'
+
value
);
console
.
log
(
'
i18n_test_8260
'
+
value
);
expect
(
value
).
assertEqual
(
7
);
})
...
...
@@ -1330,11 +1395,11 @@ describe('I18nTest', function () {
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
*/
it
(
'
i18n_test_8300
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8300
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8300
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setFirstDayOfWeek
(
1
);
let
value
=
calendar
.
getFirstDayOfWeek
();
console
.
error
(
'
i18n_test_8300
'
+
value
);
console
.
log
(
'
i18n_test_8300
'
+
value
);
expect
(
value
).
assertEqual
(
1
);
})
...
...
@@ -1344,11 +1409,11 @@ describe('I18nTest', function () {
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
*/
it
(
'
i18n_test_8320
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8320
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8320
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setFirstDayOfWeek
(
0
);
let
value
=
calendar
.
getFirstDayOfWeek
();
console
.
error
(
'
i18n_test_8320
'
+
value
);
console
.
log
(
'
i18n_test_8320
'
+
value
);
expect
(
value
).
assertEqual
(
1
);
})
...
...
@@ -1358,11 +1423,11 @@ describe('I18nTest', function () {
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
*/
it
(
'
i18n_test_8340
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8340
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8340
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setFirstDayOfWeek
(
7
);
let
value
=
calendar
.
getFirstDayOfWeek
();
console
.
error
(
'
i18n_test_8340
'
+
value
);
console
.
log
(
'
i18n_test_8340
'
+
value
);
expect
(
value
).
assertEqual
(
7
);
})
...
...
@@ -1372,11 +1437,11 @@ describe('I18nTest', function () {
* @tc.desc get the setFirstDayOfWeek and getFirstDayOfWeek value
*/
it
(
'
i18n_test_8360
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8360
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8360
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setFirstDayOfWeek
(
8
);
let
value
=
calendar
.
getFirstDayOfWeek
();
console
.
error
(
'
i18n_test_8360
'
+
value
);
console
.
log
(
'
i18n_test_8360
'
+
value
);
expect
(
value
).
assertEqual
(
1
);
})
...
...
@@ -1386,11 +1451,11 @@ describe('I18nTest', function () {
* @tc.desc get the setTimeZone and getTimeZone value
*/
it
(
'
i18n_test_8400
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8400
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8400
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setTimeZone
(
'
Asia/Shanghai
'
);
let
value
=
calendar
.
getTimeZone
();
console
.
error
(
'
i18n_test_8400
'
+
value
);
console
.
log
(
'
i18n_test_8400
'
+
value
);
expect
(
value
).
assertEqual
(
'
China Standard Time
'
);
})
...
...
@@ -1400,11 +1465,11 @@ describe('I18nTest', function () {
* @tc.desc get the setTimeZone and getTimeZone value
*/
it
(
'
i18n_test_8420
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8420
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8420
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setTimeZone
(
'
AAA
'
);
let
value
=
calendar
.
getTimeZone
();
console
.
error
(
'
i18n_test_8420
'
+
value
);
console
.
log
(
'
i18n_test_8420
'
+
value
);
expect
(
value
).
assertEqual
(
'
GMT
'
);
})
...
...
@@ -1414,11 +1479,11 @@ describe('I18nTest', function () {
* @tc.desc get the set value
*/
it
(
'
i18n_test_8500
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8500
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8500
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
set
(
2021
,
11
,
11
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8500
'
+
value
);
console
.
log
(
'
i18n_test_8500
'
+
value
);
expect
(
value
).
assertTrue
();
})
...
...
@@ -1428,11 +1493,11 @@ describe('I18nTest', function () {
* @tc.desc get the set value
*/
it
(
'
i18n_test_8520
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8520
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8520
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
set
(
2021
,
11
,
11
,
10
,
10
,
10
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8520
'
+
value
);
console
.
log
(
'
i18n_test_8520
'
+
value
);
expect
(
value
).
assertTrue
();
})
...
...
@@ -1442,11 +1507,11 @@ describe('I18nTest', function () {
* @tc.desc get the set value
*/
it
(
'
i18n_test_8540
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8540
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8540
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
set
(
2021
,
11
,
11
,
10
,
10
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8540
'
+
value
);
console
.
log
(
'
i18n_test_8540
'
+
value
);
expect
(
value
).
assertTrue
();
})
...
...
@@ -1456,13 +1521,13 @@ describe('I18nTest', function () {
* @tc.desc get the setTime value
*/
it
(
'
i18n_test_8600
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8600
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8600
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
//actuall month is 9
let
date1
=
new
Date
(
2021
,
8
,
8
,
8
,
8
,
8
,
8
);
calendar
.
setTime
(
date1
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8600
'
+
value
);
console
.
log
(
'
i18n_test_8600
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1472,12 +1537,12 @@ describe('I18nTest', function () {
* @tc.desc get the setTime value
*/
it
(
'
i18n_test_8620
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8620
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8620
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
let
date1
=
new
Date
(
2021
,
18
,
8
,
8
,
8
,
8
,
8
);
calendar
.
setTime
(
date1
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8620
'
+
value
);
console
.
log
(
'
i18n_test_8620
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1487,11 +1552,11 @@ describe('I18nTest', function () {
* @tc.desc get the setTime value
*/
it
(
'
i18n_test_8700
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8700
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8700
'
+
'
start
'
);
let
calendar
=
I18n
.
getCalendar
(
'
zh
'
);
calendar
.
setTime
(
10540800000
);
let
value
=
calendar
.
isWeekend
();
console
.
error
(
'
i18n_test_8700
'
+
value
);
console
.
log
(
'
i18n_test_8700
'
+
value
);
expect
(
value
).
assertTrue
();
})
...
...
@@ -1501,9 +1566,9 @@ describe('I18nTest', function () {
* @tc.desc get the isRTL value
*/
it
(
'
i18n_test_8800
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8800
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8800
'
+
'
start
'
);
let
value
=
I18n
.
isRTL
(
'
zh-CN
'
);
console
.
error
(
'
i18n_test_8800
'
+
value
);
console
.
log
(
'
i18n_test_8800
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1513,9 +1578,9 @@ describe('I18nTest', function () {
* @tc.desc get the isRTL value
*/
it
(
'
i18n_test_8900
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_8900
'
+
'
start
'
);
console
.
log
(
'
i18n_test_8900
'
+
'
start
'
);
let
value
=
I18n
.
isRTL
(
'
en-US
'
);
console
.
error
(
'
i18n_test_8900
'
+
value
);
console
.
log
(
'
i18n_test_8900
'
+
value
);
expect
(
value
).
assertFalse
();
})
...
...
@@ -1525,9 +1590,9 @@ describe('I18nTest', function () {
* @tc.desc get the isRTL value
*/
it
(
'
i18n_test_9000
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9000
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9000
'
+
'
start
'
);
let
value
=
I18n
.
isRTL
(
'
ar
'
);
console
.
error
(
'
i18n_test_9000
'
+
value
);
console
.
log
(
'
i18n_test_9000
'
+
value
);
expect
(
value
).
assertTrue
();
})
...
...
@@ -1537,13 +1602,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9100
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9100
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9100
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
cup
'
,
measureSystem
:
'
US
'
},
{
unit
:
'
liter
'
,
measureSystem
:
'
SI
'
},
1000
,
'
en-US
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9100
'
+
value
);
console
.
log
(
'
i18n_test_9100
'
+
value
);
expect
(
value
).
assertEqual
(
'
236.588 liters
'
);
})
...
...
@@ -1553,13 +1618,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9200
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9200
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9200
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
cup
'
,
measureSystem
:
'
US
'
},
{
unit
:
'
liter
'
,
measureSystem
:
'
SI
'
},
1000
,
'
en-US
'
,
'
medium
'
);
console
.
error
(
'
i18n_test_9200
'
+
value
);
console
.
log
(
'
i18n_test_9200
'
+
value
);
expect
(
value
).
assertEqual
(
'
236.588L
'
);
})
...
...
@@ -1569,13 +1634,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9300
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9300
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9300
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
cup
'
,
measureSystem
:
'
US
'
},
{
unit
:
'
liter
'
,
measureSystem
:
'
SI
'
},
1000
,
'
en-US
'
,
'
short
'
);
console
.
error
(
'
i18n_test_9300
'
+
value
);
console
.
log
(
'
i18n_test_9300
'
+
value
);
expect
(
value
).
assertEqual
(
'
236.588 L
'
);
})
...
...
@@ -1585,13 +1650,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9400
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9400
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9400
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
meter
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
mile
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9400
'
+
value
);
console
.
log
(
'
i18n_test_9400
'
+
value
);
expect
(
value
).
assertEqual
(
'
0.621英里
'
);
})
...
...
@@ -1601,13 +1666,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9500
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9500
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9500
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
hour
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
second
'
,
measureSystem
:
'
SI
'
},
10
,
'
zh-CN
'
,
'
medium
'
);
console
.
error
(
'
i18n_test_9500
'
+
value
);
console
.
log
(
'
i18n_test_9500
'
+
value
);
expect
(
value
).
assertEqual
(
'
36,000秒
'
);
})
...
...
@@ -1617,13 +1682,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9600
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9600
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9600
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
celsius
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
fahrenheit
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
short
'
);
console
.
error
(
'
i18n_test_9600
'
+
value
);
console
.
log
(
'
i18n_test_9600
'
+
value
);
expect
(
value
).
assertEqual
(
'
1,832°F
'
);
})
...
...
@@ -1633,13 +1698,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9700
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9700
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9700
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
acre
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
hectare
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9700
'
+
value
);
console
.
log
(
'
i18n_test_9700
'
+
value
);
expect
(
value
).
assertEqual
(
'
404.686公顷
'
);
})
...
...
@@ -1649,13 +1714,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9710
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9710
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9710
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
acre
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
square-meter
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9710
'
+
value
);
console
.
log
(
'
i18n_test_9710
'
+
value
);
expect
(
value
).
assertEqual
(
'
4,046,856.422平方米
'
);
})
...
...
@@ -1665,13 +1730,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9800
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9800
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9800
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
kilometer-per-hour
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
knot
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9800
'
+
value
);
console
.
log
(
'
i18n_test_9800
'
+
value
);
expect
(
value
).
assertEqual
(
'
539.957节
'
);
})
...
...
@@ -1681,13 +1746,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9850
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9850
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9850
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
kilometer-per-hour
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
meter-per-second
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9850
'
+
value
);
console
.
log
(
'
i18n_test_9850
'
+
value
);
expect
(
value
).
assertEqual
(
'
每秒277.778米
'
);
})
...
...
@@ -1697,13 +1762,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9900
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9900
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9900
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
meter
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
kilometer
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9900
'
+
value
);
console
.
log
(
'
i18n_test_9900
'
+
value
);
expect
(
value
).
assertEqual
(
'
1公里
'
);
})
...
...
@@ -1713,13 +1778,13 @@ describe('I18nTest', function () {
* @tc.desc get the unitConvert value
*/
it
(
'
i18n_test_9910
'
,
0
,
function
()
{
console
.
error
(
'
i18n_test_9910
'
+
'
start
'
);
console
.
log
(
'
i18n_test_9910
'
+
'
start
'
);
let
value
=
I18n
.
Util
.
unitConvert
({
unit
:
'
meter
'
,
measureSystem
:
'
SI
'
},
{
unit
:
'
meter-per-second
'
,
measureSystem
:
'
SI
'
},
1000
,
'
zh-CN
'
,
'
long
'
);
console
.
error
(
'
i18n_test_9910
'
+
value
);
console
.
log
(
'
i18n_test_9910
'
+
value
);
expect
(
value
).
assertEqual
(
'
1,000米
'
);
})
...
...
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
浏览文件 @
c47928b9
...
...
@@ -61,7 +61,7 @@ describe('LangTest', function () {
}
/* *
*
execute this step after every testcase
*
restore the init lang list
*/
function
restoreLang
(){
for
(
let
j
=
0
;
j
<
initLen
;
j
++
){
...
...
@@ -127,7 +127,14 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_clock_0100
'
+
'
start
'
);
let
value
=
I18n
.
is24HourClock
();
console
.
log
(
'
i18n_test_clock_0100
'
+
value
);
expect
(
value
).
assertFalse
();
if
(
hour
)
{
expect
(
value
).
assertTrue
();
}
else
{
expect
(
value
).
assertFalse
();
}
})
/* *
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
e9b87ab8
·
3月 20, 2022
mentioned in commit
e9b87ab8
mentioned in commit e9b87ab86872fd4f60ee29828ed0412105e28fcd
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录