未验证 提交 c4f268de 编写于 作者: O openharmony_ci 提交者: Gitee

!7399 Add test cases of generateRandomUUID and generateRandomBinaryUUID

Merge pull request !7399 from jwx1068251/master
...@@ -886,7 +886,7 @@ describe('TextEncoderTest', function () { ...@@ -886,7 +886,7 @@ describe('TextEncoderTest', function () {
var result = util.randomUUID(true); var result = util.randomUUID(true);
expect(result.length).assertEqual(36); expect(result.length).assertEqual(36);
}) })
/** /**
* @tc.name: testUtilRandomUUID002 * @tc.name: testUtilRandomUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID. * @tc.desc: Generate a random RFC 4122 version 4 UUID.
...@@ -946,6 +946,42 @@ describe('TextEncoderTest', function () { ...@@ -946,6 +946,42 @@ describe('TextEncoderTest', function () {
expect(e.message).assertEqual('Syntax Error.Invalid 84Wdf796-66cc-4655-9b89-d6218d100f9c string'); 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 () { describe('ScopeHelperTest', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册