diff --git a/commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js b/commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js index ae4e6ef5a16e2369ed13e540e690a8a4c7206ba3..559689c03d7589ff95a9939ff5a1368dffd9dc6e 100644 --- a/commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js +++ b/commonlibrary/ets_utils/util2_lib_standard/src/main/js/test/util.test.js @@ -886,7 +886,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. @@ -946,6 +946,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 () {