Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e5d4ee8d
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看板
未验证
提交
e5d4ee8d
编写于
7月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4337 add phonenum location to 3.2beta2
Merge pull request !4337 from 杨清/cherry-pick-1657851486
上级
585dba0f
cbbf1dfd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
153 addition
and
0 deletion
+153
-0
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
...18n_standard/intljs/src/main/js/default/test/I18n.test.js
+153
-0
未找到文件。
global/i18n_standard/intljs/src/main/js/default/test/I18n.test.js
浏览文件 @
e5d4ee8d
...
...
@@ -680,6 +680,159 @@ describe('I18nTest', function () {
expect
(
value
).
assertEqual
(
'
+1626202337
'
+
ran
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7810
* @tc.name test getLocationName method with 135... num in zh-CN locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7810
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7810
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7810
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
1351057467
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7810
'
+
value
);
expect
(
value
).
assertEqual
(
'
广东省深圳市
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7820
* @tc.name test getLocationName method with 135... num in en-US locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7820
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7820
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7820
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
+861351057467
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7820
'
+
value
);
expect
(
value
).
assertEqual
(
'
Shenzhen, Guangdong
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+86 1351057467
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7820
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
Shenzhen, Guangdong
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7830
* @tc.name test getLocationName method with 158... num in en-US locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7830
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7830
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7830
'
+
ran
);
let
value1
=
phonenumber
.
getLocationName
(
'
+861586661737
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7830
'
+
value1
);
expect
(
value1
).
assertEqual
(
'
Jinan, Shandong
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+86 1586661737
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7830
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
Jinan, Shandong
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7840
* @tc.name test getLocationName method with 027... num in zh-CN locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7840
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7840
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7840
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
027-5937411
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7840
'
+
value
);
expect
(
value
).
assertEqual
(
'
湖北省武汉市
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7850
* @tc.name test getLocationName method with 0728... num in zh-CN locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7850
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7850
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7850
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
0728-623797
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7850
'
+
value
);
expect
(
value
).
assertEqual
(
'
湖北省仙桃市
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7860
* @tc.name test getLocationName method with +34... num in en-US locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7860
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7860
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7860
'
+
ran
);
let
value1
=
phonenumber
.
getLocationName
(
'
+3460724205
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7860
'
+
value1
);
expect
(
value1
).
assertEqual
(
'
Spain
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+34 60724205
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7860
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
Spain
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7870
* @tc.name test getLocationName method with +39... num in en-US locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7870
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7870
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7870
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
+39342652441
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7870
'
+
value
);
expect
(
value
).
assertEqual
(
'
Italy
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+39 342652441
'
+
ran
,
'
en-US
'
);
console
.
log
(
'
i18n_test_7870
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
Italy
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7880
* @tc.name test getLocationName method with +39... num in zh-CN locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7880
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7880
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7880
'
+
ran
);
let
value
=
phonenumber
.
getLocationName
(
'
+39342652441
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7880
'
+
value
);
expect
(
value
).
assertEqual
(
'
意大利
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+39 342652441
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7880
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
意大利
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7890
* @tc.name test getLocationName method with +34... num in zh-CN locale
* @tc.desc get the getLocationName value
*/
it
(
'
i18n_test_7890
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_7890
'
+
'
start
'
);
let
phonenumber
=
new
I18n
.
PhoneNumberFormat
(
'
CN
'
);
let
ran
=
Math
.
ceil
(
Math
.
random
(
1
)
*
9
);
console
.
log
(
'
i18n_test_7890
'
+
ran
);
let
value1
=
phonenumber
.
getLocationName
(
'
+3460724205
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7890
'
+
value1
);
expect
(
value1
).
assertEqual
(
'
西班牙
'
);
let
value2
=
phonenumber
.
getLocationName
(
'
+34 60724205
'
+
ran
,
'
zh-CN
'
);
console
.
log
(
'
i18n_test_7890
'
+
value2
);
expect
(
value2
).
assertEqual
(
'
西班牙
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_JS_7900
* @tc.name test isWeekend interface
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录