提交 d856458f 编写于 作者: Y y00314596 提交者: 杨清

fixed 86483ba5 from https://gitee.com/yangqing3/xts_acts/pulls/1444

add 3.1beta cases by yangqing3@huawei.com
Signed-off-by: Ny00314596 <yangqing3@huawei.com>
上级 4ec4dc46
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import I18n from '@ohos.i18n'
import intl from '@ohos.intl'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('I18nTest', function () {
......@@ -280,7 +281,7 @@ describe('I18nTest', function () {
let lang = I18n.getSystemLanguages();
let len = lang.length;
console.log('i18n_test_2100 ' + len);
expect(len).assertLarger(0);
expect(len).assertEqual(0);
})
/* *
......@@ -354,7 +355,7 @@ describe('I18nTest', function () {
expect(region).assertTrue();
let value = I18n.isSuggested('en');
console.log('i18n_test_2300 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -368,7 +369,7 @@ describe('I18nTest', function () {
expect(region).assertTrue();
let value = I18n.isSuggested('zh-Hans');
console.log('i18n_test_2400 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -382,7 +383,7 @@ describe('I18nTest', function () {
expect(region).assertTrue();
let value = I18n.isSuggested('zh-Hans-CN');
console.log('i18n_test_2500 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -465,7 +466,7 @@ describe('I18nTest', function () {
expect(region).assertTrue();
let value = I18n.isSuggested('en-SG', 'GB');
console.log('i18n_test_3150 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -498,7 +499,7 @@ describe('I18nTest', function () {
it('i18n_test_3400', 0, function () {
let value = I18n.isSuggested('en-ZH', 'GB');
console.log('i18n_test_3400 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -509,7 +510,7 @@ describe('I18nTest', function () {
it('i18n_test_3500', 0, function () {
let value = I18n.isSuggested('en-JP', 'GB');
console.log('i18n_test_3500 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -520,7 +521,7 @@ describe('I18nTest', function () {
it('i18n_test_3600', 0, function () {
let value = I18n.isSuggested('zh-Hans-TW', 'CN');
console.log('i18n_test_3600 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -531,7 +532,7 @@ describe('I18nTest', function () {
it('i18n_test_3700', 0, function () {
let value = I18n.isSuggested('zh-Hans-CN', 'HK');
console.log('i18n_test_3700 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/* *
......@@ -608,7 +609,7 @@ describe('I18nTest', function () {
it('i18n_test_4400', 0, function () {
let value = I18n.getDisplayLanguage('zh-Hans-CN', 'en-US', true);
console.log('i18n_test_4400 ' + value);
expect(value).assertEqual('Chinese');
expect(value).assertEqual('Simplified Chinese');
})
/* *
......@@ -619,7 +620,7 @@ describe('I18nTest', function () {
it('i18n_test_4500', 0, function () {
let value = I18n.getDisplayLanguage('zh-Hans-CN', 'en-GB', true);
console.log('i18n_test_4500 ' + value);
expect(value).assertEqual('Chinese');
expect(value).assertEqual('Simplified Chinese');
})
/* *
......@@ -663,7 +664,7 @@ describe('I18nTest', function () {
it('i18n_test_4900', 0, function () {
let value = I18n.getDisplayLanguage('zh-Hans-CN', 'en-US', false);
console.log('i18n_test_4900 ' + value);
expect(value).assertEqual('Chinese');
expect(value).assertEqual('Simplified Chinese');
})
/* *
......@@ -674,7 +675,7 @@ describe('I18nTest', function () {
it('i18n_test_5000', 0, function () {
let value = I18n.getDisplayLanguage('zh-Hans-CN', 'en-US');
console.log('i18n_test_5000 ' + value);
expect(value).assertEqual('Chinese');
expect(value).assertEqual('Simplified Chinese');
})
/**
......@@ -1064,7 +1065,7 @@ describe('I18nTest', function () {
let calendar = I18n.getCalendar('zh');
let value = calendar.getDisplayName('zh');
console.error('i18n_test_8000 ' + value);
expect(value).assertEqual('公历');
expect(value).assertEqual('公历');
})
/**
......@@ -1077,7 +1078,7 @@ describe('I18nTest', function () {
let calendar = I18n.getCalendar('zh');
let value = calendar.get('year');
console.error('i18n_test_8100 ' + value);
expect(value).assertEqual(2021);
expect(value).assertLarger(0);
})
/**
......@@ -1149,7 +1150,7 @@ describe('I18nTest', function () {
calendar.setTime(date1);
let value = calendar.isWeekend();
console.error('i18n_test_8600 ' + value);
expect(value).assertTrue();
expect(value).assertFalse();
})
/**
......@@ -1247,7 +1248,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('0.621');
expect(value).assertEqual('0.621英里');
})
/**
......@@ -1259,7 +1260,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('36,000秒');
expect(value).assertEqual('36,000');
})
/**
......@@ -1271,7 +1272,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('1,832°F');
expect(value).assertEqual('1,832°F');
})
/**
......@@ -1283,7 +1284,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('404.686公顷');
expect(value).assertEqual('404.686公顷');
})
/**
......@@ -1295,7 +1296,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('4,046,856.422方米');
expect(value).assertEqual('4,046,856.422平方米');
})
/**
......@@ -1307,7 +1308,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('539.957节');
expect(value).assertEqual('539.957');
})
/**
......@@ -1319,7 +1320,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('每秒277.778米');
expect(value).assertEqual('每秒277.778米');
})
/**
......@@ -1331,7 +1332,7 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('1公里');
expect(value).assertEqual('1公里');
})
/**
......@@ -1343,7 +1344,413 @@ describe('I18nTest', function () {
console.error('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);
expect(value).assertEqual('1,000米');
expect(value).assertEqual('1,000米');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0100
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0100', 0, function () {
console.log('i18n_test_iterator_0100 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.current();
console.log('i18n_test_iterator_0100 ' + value);
expect(value).assertEqual(0);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0200
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0200', 0, function () {
console.log('i18n_test_iterator_0200 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.first();
console.log('i18n_test_iterator_0200 ' + value);
expect(value).assertEqual(0);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0300
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0300', 0, function () {
console.log('i18n_test_iterator_0300 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.last();
console.log('i18n_test_iterator_0300 ' + value);
expect(value).assertEqual(40);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0400
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0400', 0, function () {
console.log('i18n_test_iterator_0400 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.next();
console.log('i18n_test_iterator_0400 ' + value);
expect(value).assertEqual(3);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0500
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0500', 0, function () {
console.log('i18n_test_iterator_0500 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.next(2);
console.log('i18n_test_iterator_0500 ' + value);
expect(value).assertEqual(8);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0600
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0600', 0, function () {
console.log('i18n_test_iterator_0600 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.previous();
console.log('i18n_test_iterator_0600 ' + value);
expect(value).assertEqual(-1);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0700
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0700', 0, function () {
console.log('i18n_test_iterator_0700 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.following(1);
console.log('i18n_test_iterator_0700 ' + value);
expect(value).assertEqual(3);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0800
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0800', 0, function () {
console.log('i18n_test_iterator_0800 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.getLineBreakText();
console.log('i18n_test_iterator_0800 ' + value);
expect(value).assertEqual('My name is Tom.Welcome to the sky world.');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_BREAKITERATOR_0900
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_iterator_0900', 0, function () {
console.log('i18n_test_iterator_0900 ' + 'start');
let iterator =I18n.getLineInstance('en');
iterator.setLineBreakText('My name is Tom.Welcome to the sky world.');
let value = iterator.isBoundary(10);
console.log('i18n_test_iterator_0900 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_INDEXUTIL_0100
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_indexutil_0100', 0, function () {
console.log('i18n_test_indexutil_0100 ' + 'start');
let index = I18n.getInstance();
let value = index.getIndex('a');
console.log('i18n_test_indexutil_0100 ' + value);
expect(value).assertEqual('A');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_INDEXUTIL_0200
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_indexutil_0200', 0, function () {
console.log('i18n_test_indexutil_0200 ' + 'start');
let index = I18n.getInstance();
let value = index.getIndexList();
let len = value.length;
console.log('i18n_test_indexutil_0200 ' + value);
expect(len).assertLarger(0);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_INDEXUTIL_0300
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_indexutil_0300', 0, function () {
console.log('i18n_test_indexutil_0300 ' + 'start');
let index = I18n.getInstance();
index.addLocale('en');
let value = index.getIndex('a');
console.log('i18n_test_indexutil_0300 ' + value);
expect(value).assertEqual('A');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_INDEXUTIL_0400
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_indexutil_0400', 0, function () {
console.log('i18n_test_indexutil_0400 ' + 'start');
let index = I18n.getInstance('zh');
let value = index.getIndex('z');
console.log('i18n_test_indexutil_0400 ' + value);
expect(value).assertEqual('Z');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0100
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0100', 0, function () {
console.log('i18n_test_character_0100 ' + 'start');
let value = I18n.Character.isDigit('abc');
console.log('i18n_test_character_0100 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0200
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0200', 0, function () {
console.log('i18n_test_character_0200 ' + 'start');
let value = I18n.Character.isSpaceChar('abc');
console.log('i18n_test_character_0200 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0300
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0300', 0, function () {
console.log('i18n_test_character_0300 ' + 'start');
let value = I18n.Character.isWhitespace('abc');
console.log('i18n_test_character_0300 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0400
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0400', 0, function () {
console.log('i18n_test_character_0400 ' + 'start');
let value = I18n.Character.isRTL('abc');
console.log('i18n_test_character_0400 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0500
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0500', 0, function () {
console.log('i18n_test_character_0500 ' + 'start');
let value = I18n.Character.isIdeograph('abc');
console.log('i18n_test_character_0500 ' + value);
expect(value).assertFalse();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0600
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0600', 0, function () {
console.log('i18n_test_character_0600 ' + 'start');
let value = I18n.Character.isLetter('abc');
console.log('i18n_test_character_0600 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0700
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0700', 0, function () {
console.log('i18n_test_character_0700 ' + 'start');
let value = I18n.Character.isLowerCase('abc');
console.log('i18n_test_character_0700 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0800
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0800', 0, function () {
console.log('i18n_test_character_0800 ' + 'start');
let value = I18n.Character.isUpperCase('ABC');
console.log('i18n_test_character_0800 ' + value);
expect(value).assertTrue();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_CHARACTER_0900
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_character_0900', 0, function () {
console.log('i18n_test_character_0900 ' + 'start');
let value = I18n.Character.getType('a');
console.log('i18n_test_character_0900 ' + value);
expect(value).assertEqual('U_LOWERCASE_LETTER');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0100
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0100', 0, function () {
console.log('i18n_test_relativetimeformat_0100 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat();
let value = relativetimefmt.format(100,'second');
console.log('i18n_test_relativetimeformat_0100 ' + value);
expect(value).assertEqual('100秒钟后');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0200
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0200', 0, function () {
console.log('i18n_test_relativetimeformat_0200 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.format(100,'second');
console.log('i18n_test_relativetimeformat_0200 ' + value);
expect(value).assertEqual('in 100 seconds');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0300
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0300', 0, function () {
console.log('i18n_test_relativetimeformat_0300 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en', { style: 'narrow' });
let value = relativetimefmt.format(100,'second');
console.log('i18n_test_relativetimeformat_0300 ' + value);
expect(value).assertEqual('in 100 sec.');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0400
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0400', 0, function () {
console.log('i18n_test_relativetimeformat_0400 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.formatToParts(100,'second');
console.log('i18n_test_relativetimeformat_0400 ' + value[0].value + 'value');
expect(value[0].value).assertEqual('in ');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0500
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0500', 0, function () {
console.log('i18n_test_relativetimeformat_0500 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.resolvedOptions();
console.log('i18n_test_relativetimeformat_0500 ' + value);
expect(value.locale).assertEqual('en');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0600
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0600', 0, function () {
console.log('i18n_test_relativetimeformat_0600 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.resolvedOptions();
console.log('i18n_test_relativetimeformat_0600 ' + value);
expect(value.style).assertEqual('long');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0700
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0700', 0, function () {
console.log('i18n_test_relativetimeformat_0700 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.resolvedOptions();
console.log('i18n_test_relativetimeformat_0700 ' + value);
expect(value.numeric).assertEqual('always');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0800
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0800', 0, function () {
console.log('i18n_test_relativetimeformat_0800 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en');
let value = relativetimefmt.resolvedOptions();
console.log('i18n_test_relativetimeformat_0800 ' + value.numberingSystem);
expect(value.numberingSystem).assertEqual('latn');
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_RELATIVETIMEFORMAT_0900
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it('i18n_test_relativetimeformat_0900', 0, function () {
console.log('i18n_test_relativetimeformat_0900 ' + 'start');
let relativetimefmt = new intl.RelativeTimeFormat('en', { localeMatcher: 'best fit', numeric: 'auto', style: 'narrow' });
let value = relativetimefmt.resolvedOptions();
console.log('i18n_test_relativetimeformat_0900 ' + value);
expect(value.numeric).assertEqual('auto');
expect(value.style).assertEqual('narrow');
})
console.log('*************end I18NTest*************');
......
......@@ -295,5 +295,35 @@ describe('resMgrTest', function () {
done();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1700
* @tc.name test getRawFile method in callback mode
* @tc.desc get the getRawFile in callback mode
*/
it('getRawFile_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getRawFile('rawfile/rawfiletest.xml', (error, value) => {
expect(value !== null).assertTrue();
console.log('getRawFile_test_001 ' + value);
})
})
done();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1800
* @tc.name test getRawFile method in promise mode
* @tc.desc get the getRawFile in promise mode
*/
it('getRawFile_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getRawFile('rawfile/rawfiletest.xml').then(value => {
expect(value !== null).assertTrue();
console.log('getRawFile_test_002 ' + value);
})
})
done();
})
console.log('*************end ResmgrTest*************');
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册