mirror of
https://github.com/coder/code-server.git
synced 2026-05-30 17:09:32 +00:00
Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
23
lib/vscode/src/vs/base/test/common/uuid.test.ts
Normal file
23
lib/vscode/src/vs/base/test/common/uuid.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import * as uuid from 'vs/base/common/uuid';
|
||||
|
||||
suite('UUID', () => {
|
||||
test('generation', () => {
|
||||
const asHex = uuid.generateUuid();
|
||||
assert.equal(asHex.length, 36);
|
||||
assert.equal(asHex[14], '4');
|
||||
assert.ok(asHex[19] === '8' || asHex[19] === '9' || asHex[19] === 'a' || asHex[19] === 'b');
|
||||
});
|
||||
|
||||
test('self-check', function () {
|
||||
const t1 = Date.now();
|
||||
while (Date.now() - t1 < 50) {
|
||||
const value = uuid.generateUuid();
|
||||
assert.ok(uuid.isUUID(value));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user