source: imaps-frontend/node_modules/uuid/dist/cjs/test/test_constants.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 6.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.TESTS = void 0;
4const max_js_1 = require("../max.js");
5const nil_js_1 = require("../nil.js");
6exports.TESTS = [
7 { value: nil_js_1.default, expectedValidate: true, expectedVersion: 0 },
8 { value: max_js_1.default, expectedValidate: true, expectedVersion: 15 },
9 { value: '00000000-0000-1000-8000-000000000000', expectedValidate: true, expectedVersion: 1 },
10 { value: 'ffffffff-ffff-1fff-8fff-ffffffffffff', expectedValidate: true, expectedVersion: 1 },
11 { value: '00000000-0000-2000-8000-000000000000', expectedValidate: true, expectedVersion: 2 },
12 { value: 'ffffffff-ffff-2fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 2 },
13 { value: '00000000-0000-3000-8000-000000000000', expectedValidate: true, expectedVersion: 3 },
14 { value: 'ffffffff-ffff-3fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 3 },
15 { value: '00000000-0000-4000-8000-000000000000', expectedValidate: true, expectedVersion: 4 },
16 { value: 'ffffffff-ffff-4fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 4 },
17 { value: '00000000-0000-5000-8000-000000000000', expectedValidate: true, expectedVersion: 5 },
18 { value: 'ffffffff-ffff-5fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 5 },
19 { value: '00000000-0000-6000-8000-000000000000', expectedValidate: true, expectedVersion: 6 },
20 { value: 'ffffffff-ffff-6fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 6 },
21 { value: '00000000-0000-7000-8000-000000000000', expectedValidate: true, expectedVersion: 7 },
22 { value: 'ffffffff-ffff-7fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 7 },
23 { value: '00000000-0000-8000-8000-000000000000', expectedValidate: true, expectedVersion: 8 },
24 { value: 'ffffffff-ffff-8fff-bfff-ffffffffffff', expectedValidate: true, expectedVersion: 8 },
25 { value: '00000000-0000-9000-8000-000000000000', expectedValidate: false },
26 { value: 'ffffffff-ffff-9fff-bfff-ffffffffffff', expectedValidate: false },
27 { value: '00000000-0000-a000-8000-000000000000', expectedValidate: false },
28 { value: 'ffffffff-ffff-afff-bfff-ffffffffffff', expectedValidate: false },
29 { value: '00000000-0000-b000-8000-000000000000', expectedValidate: false },
30 { value: 'ffffffff-ffff-bfff-bfff-ffffffffffff', expectedValidate: false },
31 { value: '00000000-0000-c000-8000-000000000000', expectedValidate: false },
32 { value: 'ffffffff-ffff-cfff-bfff-ffffffffffff', expectedValidate: false },
33 { value: '00000000-0000-d000-8000-000000000000', expectedValidate: false },
34 { value: 'ffffffff-ffff-dfff-bfff-ffffffffffff', expectedValidate: false },
35 { value: '00000000-0000-e000-8000-000000000000', expectedValidate: false },
36 { value: 'ffffffff-ffff-efff-bfff-ffffffffffff', expectedValidate: false },
37 { value: 'd9428888-122b-11e1-b85c-61cd3cbb3210', expectedValidate: true, expectedVersion: 1 },
38 { value: '000003e8-2363-21ef-b200-325096b39f47', expectedValidate: true, expectedVersion: 2 },
39 { value: 'a981a0c2-68b1-35dc-bcfc-296e52ab01ec', expectedValidate: true, expectedVersion: 3 },
40 { value: '109156be-c4fb-41ea-b1b4-efe1671c5836', expectedValidate: true, expectedVersion: 4 },
41 { value: '90123e1c-7512-523e-bb28-76fab9f2f73d', expectedValidate: true, expectedVersion: 5 },
42 { value: '1ef21d2f-1207-6660-8c4f-419efbd44d48', expectedValidate: true, expectedVersion: 6 },
43 { value: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', expectedValidate: true, expectedVersion: 7 },
44 { value: '0d8f23a0-697f-83ae-802e-48f3756dd581', expectedValidate: true, expectedVersion: 8 },
45 { value: '00000000-0000-1000-0000-000000000000', expectedValidate: false },
46 { value: '00000000-0000-1000-1000-000000000000', expectedValidate: false },
47 { value: '00000000-0000-1000-2000-000000000000', expectedValidate: false },
48 { value: '00000000-0000-1000-3000-000000000000', expectedValidate: false },
49 { value: '00000000-0000-1000-4000-000000000000', expectedValidate: false },
50 { value: '00000000-0000-1000-5000-000000000000', expectedValidate: false },
51 { value: '00000000-0000-1000-6000-000000000000', expectedValidate: false },
52 { value: '00000000-0000-1000-7000-000000000000', expectedValidate: false },
53 { value: '00000000-0000-1000-8000-000000000000', expectedValidate: true, expectedVersion: 1 },
54 { value: '00000000-0000-1000-9000-000000000000', expectedValidate: true, expectedVersion: 1 },
55 { value: '00000000-0000-1000-a000-000000000000', expectedValidate: true, expectedVersion: 1 },
56 { value: '00000000-0000-1000-b000-000000000000', expectedValidate: true, expectedVersion: 1 },
57 { value: '00000000-0000-1000-c000-000000000000', expectedValidate: false },
58 { value: '00000000-0000-1000-d000-000000000000', expectedValidate: false },
59 { value: '00000000-0000-1000-e000-000000000000', expectedValidate: false },
60 { value: '00000000-0000-1000-f000-000000000000', expectedValidate: false },
61 { value: '00000000000000000000000000000000', expectedValidate: false },
62 { value: '', expectedValidate: false },
63 { value: 'invalid uuid string', expectedValidate: false },
64 {
65 value: '=Y00a-f*vb*-c-d#-p00f\b-g0h-#i^-j*3&-L00k-\nl---00n-fg000-00p-00r+',
66 expectedValidate: false,
67 },
68 { value: undefined, expectedValidate: false },
69 { value: null, expectedValidate: false },
70 { value: 123, expectedValidate: false },
71 { value: /regex/, expectedValidate: false },
72 { value: new Date(0), expectedValidate: false },
73 { value: false, expectedValidate: false },
74];
75for (let charIndex = 0; charIndex < 36; charIndex++) {
76 if (charIndex === 8 ||
77 charIndex === 13 ||
78 charIndex === 14 ||
79 charIndex === 18 ||
80 charIndex === 23) {
81 continue;
82 }
83 const nilChars = nil_js_1.default.split('');
84 const maxChars = max_js_1.default.split('');
85 for (let i = 0; i < 4; i++) {
86 nilChars[charIndex] = (0x0 ^ (1 << i)).toString(16);
87 exports.TESTS.push({ value: nilChars.join(''), expectedValidate: false });
88 maxChars[charIndex] = (0xf ^ (1 << i)).toString(16);
89 exports.TESTS.push({ value: maxChars.join(''), expectedValidate: false });
90 }
91}
Note: See TracBrowser for help on using the repository browser.