提交 56d32f7f 编写于 作者: J jiangkai43 提交者: jwx1068251

fixed 0edc839d from https://gitee.com/jiangkai43/xts_acts/pulls/7399

Add test cases of generateRandomUUID and generateRandomBinaryUUID

https://gitee.com/openharmony/xts_acts/issues/I6CO24Signed-off-by: Njiangkai43 <jiangkai43@huawei.com>
上级 e9630310
......@@ -890,7 +890,7 @@ describe('TextEncoderTest', function () {
var result = util.randomUUID(true);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilRandomUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
......@@ -950,6 +950,42 @@ describe('TextEncoderTest', function () {
expect(e.message).assertEqual('Syntax Error.Invalid 84Wdf796-66cc-4655-9b89-d6218d100f9c string');
}
})
/**
* @tc.name: testUtilgenerateRandomUUID001
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomUUID001', 0, async function () {
var result = util.generateRandomUUID(true);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilgenerateRandomUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomUUID002', 0, async function () {
var result = util.generateRandomUUID(false);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilgenerateRandomBinaryUUID001
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomBinaryUUID001', 0, async function () {
var result = util.generateRandomBinaryUUID(true);
expect(result.length).assertEqual(16);
})
/**
* @tc.name: testUtilgenerateRandomBinaryUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomBinaryUUID002', 0, async function () {
var result = util.generateRandomBinaryUUID(false);
expect(result.length).assertEqual(16);
})
})
describe('ScopeHelperTest', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册