提交 35c7ffe1 编写于 作者: L leiyuqian 提交者: 南先森

fixed 1b8b3613 from https://gitee.com/nan-xiansen/xts_acts/pulls/6005

modify six testcase regular expression
Signed-off-by: Nleiyuqian <leiyuqian1@huawei.com>
Change-Id: I318f0b484d4cc3477a42fcf48dfdd3250c100e84
上级 24293b7f
......@@ -18,7 +18,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import deviceinfo from '@ohos.deviceInfo'
export default function DeviceInfoTest() {
describe('DeviceInfoTest', function () {
describe('DeviceInfoTest', function () {
const MAX_CHARACTERS_NUM_ONE = 33;
const MAX_CHARACTERS_NUM_TWO = 65;
......@@ -161,7 +161,7 @@ describe('DeviceInfoTest', function () {
expect(productSeriesInfo).assertInstanceOf('String');
if (productSeriesInfo != "" && productSeriesInfo != null && productSeriesInfo != undefined) {
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let arr = productSeriesInfo.match(str);
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
......@@ -212,7 +212,7 @@ describe('DeviceInfoTest', function () {
expect(softwareModelInfo).assertInstanceOf('String');
if (softwareModelInfo != "" && softwareModelInfo != null && softwareModelInfo != undefined) {
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let arr = softwareModelInfo.match(str);
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
......@@ -938,7 +938,7 @@ describe('DeviceInfoTest', function () {
let productSeriesInfo = deviceinfo.productSeries;
console.info('the value of the deviceinfo productSeries is :' + productSeriesInfo);
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let len = productSeriesInfo.length
console.info('the value of the product series characters is :' + len);
expect(len).assertLess(MAX_CHARACTERS_NUM_ONE);
......@@ -987,7 +987,7 @@ describe('DeviceInfoTest', function () {
console.info('the value of the internal software sub-model characters is :' + len);
expect(len).assertLess(MAX_CHARACTERS_NUM_ONE);
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let arr = softwareModelInfo.match(str);
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
......@@ -1297,7 +1297,7 @@ describe('DeviceInfoTest', function () {
console.info('the value of the product series characters is :' + len);
expect(len).assertLarger(MAX_CHARACTERS_NUM);
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let arr = productSeriesInfo.match(str);
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
......@@ -1334,7 +1334,7 @@ describe('DeviceInfoTest', function () {
* @tc.level : Level 0
*/
it('device_info_test_051', 0, function () {
console.info('device_info_test_036 start');
console.info('device_info_test_051 start');
let softwareModelInfo = deviceinfo.softwareModel;
console.info('the value of the deviceinfo softwareModel is :' + softwareModelInfo);
......@@ -1342,13 +1342,13 @@ describe('DeviceInfoTest', function () {
console.info('the value of the internal software sub-model characters is :' + len)
expect(len).assertLarger(MAX_CHARACTERS_NUM);
let str = /[\w-\.\(\)]/g;
let str = /[\w-\.\(\)\s]/g;
let arr = softwareModelInfo.match(str);
let bufferstr = arr.join('');
console.info('the value of the bufferstr is :' + bufferstr);
expect(softwareModelInfo).assertEqual(bufferstr);
console.info('device_info_test_036 :end')
console.info('device_info_test_051 :end')
})
/**
......@@ -1635,5 +1635,5 @@ describe('DeviceInfoTest', function () {
expect(len).assertLess(MAX_CHARACTERS_NUM_TWO)
console.info('device_info_test_064 : end');
})
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册