Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
010980fc
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看板
未验证
提交
010980fc
编写于
1月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1700 modify testcases on 20220125
Merge pull request !1700 from 杨清/1228
上级
0e596e6f
f3df7db0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
19 deletion
+46
-19
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
...18n_standard/intljs/src/main/js/default/test/Lang.test.js
+46
-19
未找到文件。
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
浏览文件 @
010980fc
...
...
@@ -52,10 +52,17 @@ describe('LangTest', function () {
function
restoreLang
(){
for
(
let
j
=
0
;
j
<
initLen
;
j
++
){
let
value
=
I18n
.
addPreferredLanguage
(
initPreferredLang
[
j
]);
let
value
=
I18n
.
addPreferredLanguage
(
initPreferredLang
[
j
]
,
j
);
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
value
);
expect
(
value
).
assertTrue
();
}
let
currLen
=
getCurrentPreferredLang
().
length
;
while
(
currLen
>
initLen
)
{
let
rem
=
I18n
.
removePreferredLanguage
(
currLen
-
1
);
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
rem
);
currLen
--
;
}
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
I18n
.
getPreferredLanguageList
());
}
beforeEach
(
function
(){
...
...
@@ -67,6 +74,7 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_preferredlanguage_afterEach
'
+
currLang
);
clearLang
(
currLang
);
restoreLang
();
I18n
.
set24HourClock
(
false
);
})
/* *
...
...
@@ -78,7 +86,7 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_clock_0100
'
+
'
start
'
);
let
value
=
I18n
.
is24HourClock
();
console
.
log
(
'
i18n_test_clock_0100
'
+
value
);
expect
(
value
).
assert
Tru
e
();
expect
(
value
).
assert
Fals
e
();
})
/* *
...
...
@@ -88,12 +96,12 @@ describe('LangTest', function () {
*/
it
(
'
i18n_test_clock_0200
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_clock_0200
'
+
'
start
'
);
let
value
=
I18n
.
set24HourClock
(
fals
e
);
let
value
=
I18n
.
set24HourClock
(
tru
e
);
console
.
log
(
'
i18n_test_clock_0200
'
+
value
);
expect
(
value
).
assertTrue
();
let
value2
=
I18n
.
is24HourClock
();
console
.
log
(
'
i18n_test_clock_0200
'
+
value2
);
expect
(
value2
).
assert
Fals
e
();
expect
(
value2
).
assert
Tru
e
();
})
/* *
...
...
@@ -103,12 +111,12 @@ describe('LangTest', function () {
*/
it
(
'
i18n_test_clock_0300
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_clock_0300
'
+
'
start
'
);
let
value
=
I18n
.
set24HourClock
(
tru
e
);
let
value
=
I18n
.
set24HourClock
(
fals
e
);
console
.
log
(
'
i18n_test_clock_0300
'
+
value
);
expect
(
value
).
assertTrue
();
let
value2
=
I18n
.
is24HourClock
();
console
.
log
(
'
i18n_test_clock_0300
'
+
value2
);
expect
(
value
).
assertTru
e
();
expect
(
value
2
).
assertFals
e
();
})
/* *
...
...
@@ -269,7 +277,7 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_preferredlanguage_0700
'
+
'
start
'
);
let
value
=
I18n
.
removePreferredLanguage
(
0
);
console
.
log
(
'
i18n_test_preferredlanguage_0700
'
+
value
);
expect
(
value
).
assert
Tru
e
();
expect
(
value
).
assert
Fals
e
();
let
list
=
I18n
.
getPreferredLanguageList
();
console
.
log
(
'
i18n_test_preferredlanguage_0700
'
+
list
);
expect
(
list
.
length
).
assertLarger
(
0
);
...
...
@@ -299,12 +307,30 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_preferredlanguage_0800
'
+
'
start
'
);
let
value
=
I18n
.
removePreferredLanguage
(
-
1
);
console
.
log
(
'
i18n_test_preferredlanguage_0800
'
+
value
);
expect
(
value
).
assert
Tru
e
();
expect
(
value
).
assert
Fals
e
();
let
list
=
I18n
.
getPreferredLanguageList
();
console
.
log
(
'
i18n_test_preferredlanguage_0800
'
+
list
);
expect
(
list
.
length
).
assertLarger
(
0
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_PREFERREDLANGUAGE_0820
* @tc.name test the removePreferredLanguage interface with -1 param
* @tc.desc check the value of removePreferredLanguage method
*/
it
(
'
i18n_test_preferredlanguage_0820
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_preferredlanguage_0820
'
+
'
start
'
);
let
value
=
I18n
.
addPreferredLanguage
(
'
ja
'
);
console
.
log
(
'
i18n_test_preferredlanguage_0500
'
+
value
);
expect
(
value
).
assertTrue
();
let
value2
=
I18n
.
removePreferredLanguage
(
-
1
);
console
.
log
(
'
i18n_test_preferredlanguage_0820
'
+
value2
);
expect
(
value2
).
assertTrue
();
let
list
=
I18n
.
getPreferredLanguageList
();
console
.
log
(
'
i18n_test_preferredlanguage_0820
'
+
list
);
expect
(
list
.
length
).
assertLarger
(
0
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_PREFERREDLANGUAGE_0900
* @tc.name test the addPreferredLanguage interface
...
...
@@ -318,9 +344,10 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_preferredlanguage_0900
'
+
len
);
expect
(
len
).
assertLarger
(
0
);
let
parm
=
len
-
1
;
console
.
log
(
'
i18n_test_preferredlanguage_0900
'
+
parm
);
let
value
=
I18n
.
removePreferredLanguage
(
parm
);
console
.
log
(
'
i18n_test_preferredlanguage_0900
'
+
value
);
expect
(
value
).
assert
Tru
e
();
expect
(
value
).
assert
Fals
e
();
})
/* *
...
...
@@ -371,7 +398,7 @@ describe('LangTest', function () {
expect
(
value5
).
assertTrue
();
let
value6
=
I18n
.
addPreferredLanguage
(
'
en
'
,
1
);
console
.
log
(
'
i18n_test_preferredlanguage_0940
'
+
value6
);
expect
(
value6
).
assert
Tru
e
();
expect
(
value6
).
assert
Fals
e
();
let
list2
=
I18n
.
getPreferredLanguageList
();
console
.
log
(
'
i18n_test_preferredlanguage_0940
'
+
list2
);
expect
(
list2
[
1
]).
assertEqual
(
'
en
'
);
...
...
@@ -397,15 +424,15 @@ describe('LangTest', function () {
* @tc.name test the addPreferredLanguage interface
* @tc.desc check the value of addPreferredLanguage method
*/
//
it('i18n_test_preferredlanguage_1000', 0, function () {
//
console.log('i18n_test_preferredlanguage_1000 ' + 'start');
//
let value = I18n.getFirstPreferredLanguage();
//
console.log('i18n_test_preferredlanguage_1000 ' + value);
// expect(value).assertEqual('en
');
//
let list = I18n.getPreferredLanguageList();
//
console.log('i18n_test_preferredlanguage_1000 ' + list);
//
expect(list.length).assertLarger(0);
//
})
it
(
'
i18n_test_preferredlanguage_1000
'
,
0
,
function
()
{
console
.
log
(
'
i18n_test_preferredlanguage_1000
'
+
'
start
'
);
let
value
=
I18n
.
getFirstPreferredLanguage
();
console
.
log
(
'
i18n_test_preferredlanguage_1000
'
+
value
);
expect
(
value
).
assertEqual
(
'
zh-Hans
'
);
let
list
=
I18n
.
getPreferredLanguageList
();
console
.
log
(
'
i18n_test_preferredlanguage_1000
'
+
list
);
expect
(
list
.
length
).
assertLarger
(
0
);
})
console
.
log
(
'
*************end LangTest*************
'
);
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录