functionalscript 0.0.424 → 0.0.425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/com/cpp/test/build.cjs +1 -1
- package/com/cpp/{test.f.cjs → testlib.f.cjs} +1 -1
- package/com/cs/test/build.cjs +1 -1
- package/com/cs/{test.f.cjs → testlib.f.cjs} +1 -1
- package/com/rust/test.f.cjs +2 -4
- package/com/types/{test.f.cjs → testlib.f.cjs} +0 -0
- package/commonjs/build/test.f.cjs +2 -4
- package/commonjs/package/dependencies/test.f.cjs +1 -3
- package/commonjs/package/test.f.cjs +1 -5
- package/commonjs/path/test.f.cjs +158 -170
- package/commonjs/test.cjs +52 -61
- package/html/test.f.cjs +12 -13
- package/json/test.f.cjs +41 -37
- package/json/tokenizer/test.f.cjs +238 -296
- package/nodejs/version/test.f.cjs +1 -3
- package/package.json +1 -1
- package/sha2/test.f.cjs +37 -40
- package/text/test.f.cjs +1 -3
- package/text/utf16/test.f.cjs +96 -109
- package/text/utf8/test.f.cjs +116 -135
- package/types/array/test.f.cjs +84 -84
- package/types/btree/find/test.f.cjs +2 -2
- package/types/btree/remove/test.f.cjs +6 -3
- package/types/btree/set/test.f.cjs +372 -370
- package/types/btree/test.f.cjs +11 -7
- package/types/byteSet/module.f.cjs +2 -4
- package/types/byteSet/test.f.cjs +37 -40
- package/types/function/compare/module.f.cjs +1 -1
- package/types/function/compare/test.f.cjs +1 -3
- package/types/function/test.f.cjs +1 -3
- package/types/list/test.f.cjs +208 -219
- package/types/map/test.f.cjs +57 -57
- package/types/nibbleSet/test.f.cjs +37 -40
- package/types/number/test.f.cjs +24 -26
- package/types/object/test.f.cjs +12 -13
- package/types/option/test.f.cjs +1 -3
- package/types/range/test.f.cjs +1 -3
|
@@ -77,7 +77,7 @@ const buffer = s => ({
|
|
|
77
77
|
toString: () => s
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
{
|
|
80
|
+
module.exports = () => {
|
|
81
81
|
/** @type {_.Node<string>} */
|
|
82
82
|
const node = {
|
|
83
83
|
child_process: { execSync: () => buffer("123\n456\n") },
|
|
@@ -89,5 +89,3 @@ const buffer = s => ({
|
|
|
89
89
|
const v = _.version(node)
|
|
90
90
|
if (v !== e) { throw [v, e] }
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
module.exports = {}
|
package/package.json
CHANGED
package/sha2/test.f.cjs
CHANGED
|
@@ -32,45 +32,42 @@ const stringify = a => json.stringify(sort)(a)
|
|
|
32
32
|
// console.log(result.map(toHexString))
|
|
33
33
|
// }
|
|
34
34
|
|
|
35
|
-
{
|
|
36
|
-
const hash = _.computeSha256([])(0)
|
|
37
|
-
const result = stringify(hash.map(toHexString))
|
|
38
|
-
if (result !== '["e3b0c442","98fc1c14","9afbf4c8","996fb924","27ae41e4","649b934c","a495991b","7852b855"]') { throw result }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
const hash = _.computeSha224([])(0)
|
|
43
|
-
const result = stringify(hash.map(toHexString))
|
|
44
|
-
if (result !== '["d14a028c","2a3a2bc9","476102bb","288234c4","15a2b01f","828ea62a","c5b3e42f","bdd387cb"]') { throw result }
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
//[0x68656C6C, 0x6F20776F, 0x726C6400] represents phrase 'hello world'
|
|
49
|
-
const hash = _.computeSha256([0x68656C6C, 0x6F20776F, 0x726C6400])(88)
|
|
50
|
-
const result = stringify(hash.map(toHexString))
|
|
51
|
-
if (result !== '["b94d27b9","934d3e08","a52e52d7","da7dabfa","c484efe3","7a5380ee","9088f7ac","e2efcde9"]') { throw result }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
//[0x68656C6C, 0x6F20776F, 0x726C6488] represents phrase 'hello world' with 1's at the end
|
|
56
|
-
const hash = _.computeSha256([0x68656C6C, 0x6F20776F, 0x726C64FF])(88)
|
|
57
|
-
const result = stringify(hash.map(toHexString))
|
|
58
|
-
if (result !== '["b94d27b9","934d3e08","a52e52d7","da7dabfa","c484efe3","7a5380ee","9088f7ac","e2efcde9"]') { throw result }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
const input = Array(8).fill(0x31313131)
|
|
63
|
-
const result = _.computeSha256(input)(256)
|
|
64
|
-
if (toU32(result[0]) !== 0x8a83665f) { throw result[0] }
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
const input = Array(16).fill(0x31313131)
|
|
69
|
-
const hash = _.computeSha256(input)(512)
|
|
70
|
-
const result = stringify(hash.map(toHexString))
|
|
71
|
-
if (result !== '["3138bb9b","c78df27c","473ecfd1","410f7bd4","5ebac1f5","9cf3ff9c","fe4db77a","ab7aedd3"]') { throw result }
|
|
72
|
-
}
|
|
73
|
-
|
|
74
35
|
module.exports = {
|
|
75
|
-
|
|
36
|
+
empty: {
|
|
37
|
+
sha256: () => {
|
|
38
|
+
const hash = _.computeSha256([])(0)
|
|
39
|
+
const result = stringify(hash.map(toHexString))
|
|
40
|
+
if (result !== '["e3b0c442","98fc1c14","9afbf4c8","996fb924","27ae41e4","649b934c","a495991b","7852b855"]') { throw result }
|
|
41
|
+
},
|
|
42
|
+
sha224: () => {
|
|
43
|
+
const hash = _.computeSha224([])(0)
|
|
44
|
+
const result = stringify(hash.map(toHexString))
|
|
45
|
+
if (result !== '["d14a028c","2a3a2bc9","476102bb","288234c4","15a2b01f","828ea62a","c5b3e42f","bdd387cb"]') { throw result }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
sha256: [
|
|
49
|
+
() => {
|
|
50
|
+
//[0x68656C6C, 0x6F20776F, 0x726C6400] represents phrase 'hello world'
|
|
51
|
+
const hash = _.computeSha256([0x68656C6C, 0x6F20776F, 0x726C6400])(88)
|
|
52
|
+
const result = stringify(hash.map(toHexString))
|
|
53
|
+
if (result !== '["b94d27b9","934d3e08","a52e52d7","da7dabfa","c484efe3","7a5380ee","9088f7ac","e2efcde9"]') { throw result }
|
|
54
|
+
},
|
|
55
|
+
() => {
|
|
56
|
+
//[0x68656C6C, 0x6F20776F, 0x726C6488] represents phrase 'hello world' with 1's at the end
|
|
57
|
+
const hash = _.computeSha256([0x68656C6C, 0x6F20776F, 0x726C64FF])(88)
|
|
58
|
+
const result = stringify(hash.map(toHexString))
|
|
59
|
+
if (result !== '["b94d27b9","934d3e08","a52e52d7","da7dabfa","c484efe3","7a5380ee","9088f7ac","e2efcde9"]') { throw result }
|
|
60
|
+
},
|
|
61
|
+
() => {
|
|
62
|
+
const input = Array(8).fill(0x31313131)
|
|
63
|
+
const result = _.computeSha256(input)(256)
|
|
64
|
+
if (toU32(result[0]) !== 0x8a83665f) { throw result[0] }
|
|
65
|
+
},
|
|
66
|
+
() => {
|
|
67
|
+
const input = Array(16).fill(0x31313131)
|
|
68
|
+
const hash = _.computeSha256(input)(512)
|
|
69
|
+
const result = stringify(hash.map(toHexString))
|
|
70
|
+
if (result !== '["3138bb9b","c78df27c","473ecfd1","410f7bd4","5ebac1f5","9cf3ff9c","fe4db77a","ab7aedd3"]') { throw result }
|
|
71
|
+
}
|
|
72
|
+
]
|
|
76
73
|
}
|
package/text/test.f.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const _ = require('./module.f.cjs')
|
|
2
2
|
const { string: { join } } = require('../types/module.f.cjs')
|
|
3
3
|
|
|
4
|
-
{
|
|
4
|
+
module.exports = () => {
|
|
5
5
|
/** @type {_.Block} */
|
|
6
6
|
const text = [
|
|
7
7
|
'a',
|
|
@@ -15,5 +15,3 @@ const { string: { join } } = require('../types/module.f.cjs')
|
|
|
15
15
|
const result = join('\n')(_.flat(':')(text))
|
|
16
16
|
if (result !== 'a\nb\n:c\n::d\ne') { throw result }
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
module.exports = {}
|
package/text/utf16/test.f.cjs
CHANGED
|
@@ -6,113 +6,100 @@ const { list } = require('../../types/module.f.cjs')
|
|
|
6
6
|
/** @type {(a: readonly json.Unknown[]) => string} */
|
|
7
7
|
const stringify = a => json.stringify(sort)(a)
|
|
8
8
|
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
module.exports = {
|
|
10
|
+
toCodePointList: [
|
|
11
|
+
() => {
|
|
12
|
+
const result = stringify(list.toArray(encoding.toCodePointList([-1, 65536])))
|
|
13
|
+
if (result !== '[4294967295,4294967295]') { throw result }
|
|
14
|
+
},
|
|
15
|
+
() => {
|
|
16
|
+
const result = stringify(list.toArray(encoding.toCodePointList([0, 36, 8364, 55295, 57344, 65535])))
|
|
17
|
+
if (result !== '[0,36,8364,55295,57344,65535]') { throw result }
|
|
18
|
+
},
|
|
19
|
+
() => {
|
|
20
|
+
const result = stringify(list.toArray(encoding.toCodePointList([56320, 57343])))
|
|
21
|
+
if (result !== '[-2147427328,-2147426305]') { throw result }
|
|
22
|
+
},
|
|
23
|
+
() => {
|
|
24
|
+
const result = stringify(list.toArray(encoding.toCodePointList([55296, 56320, 55297, 56375, 55378, 57186, 56319, 57343])))
|
|
25
|
+
if (result !== '[65536,66615,150370,1114111]') { throw result }
|
|
26
|
+
},
|
|
27
|
+
() => {
|
|
28
|
+
const result = stringify(list.toArray(encoding.toCodePointList([55296, 55296])))
|
|
29
|
+
if (result !== '[-2147428352,-2147428352]') { throw result }
|
|
30
|
+
},
|
|
31
|
+
() => {
|
|
32
|
+
const result = stringify(list.toArray(encoding.toCodePointList([55296, 0])))
|
|
33
|
+
if (result !== '[-2147428352,0]') { throw result }
|
|
34
|
+
},
|
|
35
|
+
() => {
|
|
36
|
+
const result = stringify(list.toArray(encoding.toCodePointList([56320])))
|
|
37
|
+
if (result !== '[-2147427328]') { throw result }
|
|
38
|
+
},
|
|
39
|
+
() => {
|
|
40
|
+
const result = stringify(list.toArray(encoding.toCodePointList([56320, 0])))
|
|
41
|
+
if (result !== '[-2147427328,0]') { throw result }
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
fromCodePointList: [
|
|
45
|
+
() => {
|
|
46
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0])))
|
|
47
|
+
if (result !== '[0]') { throw result }
|
|
48
|
+
},
|
|
49
|
+
() => {
|
|
50
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x24])))
|
|
51
|
+
if (result !== '[36]') { throw result }
|
|
52
|
+
},
|
|
53
|
+
() => {
|
|
54
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x20AC])))
|
|
55
|
+
if (result !== '[8364]') { throw result }
|
|
56
|
+
},
|
|
57
|
+
() => {
|
|
58
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0xd7ff])))
|
|
59
|
+
if (result !== '[55295]') { throw result }
|
|
60
|
+
},
|
|
61
|
+
() => {
|
|
62
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0xe000])))
|
|
63
|
+
if (result !== '[57344]') { throw result }
|
|
64
|
+
},
|
|
65
|
+
() => {
|
|
66
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0xffff])))
|
|
67
|
+
if (result !== '[65535]') { throw result }
|
|
68
|
+
},
|
|
69
|
+
() => {
|
|
70
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10000])))
|
|
71
|
+
if (result !== '[55296,56320]') { throw result }
|
|
72
|
+
},
|
|
73
|
+
() => {
|
|
74
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10437])))
|
|
75
|
+
if (result !== '[55297,56375]') { throw result }
|
|
76
|
+
},
|
|
77
|
+
() => {
|
|
78
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x24B62])))
|
|
79
|
+
if (result !== '[55378,57186]') { throw result }
|
|
80
|
+
},
|
|
81
|
+
() => {
|
|
82
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10ffff])))
|
|
83
|
+
if (result !== '[56319,57343]') { throw result }
|
|
84
|
+
},
|
|
85
|
+
() => {
|
|
86
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([-1, 0xd800, 0xdfff, 0x110000])))
|
|
87
|
+
if (result !== '[65535,55296,57343,0]') { throw result }
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
string: [
|
|
91
|
+
() => {
|
|
92
|
+
const utf16List = encoding.stringToList("Hello world!😂🚜🚲")
|
|
93
|
+
const result = encoding.listToString(utf16List)
|
|
94
|
+
if (result !== "Hello world!😂🚜🚲") { throw result }
|
|
95
|
+
},
|
|
96
|
+
() => {
|
|
97
|
+
const a = encoding.stringToList("Hello world!😂🚜🚲")
|
|
98
|
+
const b = encoding.toCodePointList(a)
|
|
99
|
+
const c = encoding.fromCodePointList(b)
|
|
100
|
+
const result = encoding.listToString(c)
|
|
101
|
+
if (result !== "Hello world!😂🚜🚲") { throw result }
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
]
|
|
12
105
|
}
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
const result = stringify(list.toArray(encoding.toCodePointList([0, 36, 8364, 55295, 57344, 65535])))
|
|
16
|
-
if (result !== '[0,36,8364,55295,57344,65535]') { throw result }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
const result = stringify(list.toArray(encoding.toCodePointList([56320, 57343])))
|
|
21
|
-
if (result !== '[-2147427328,-2147426305]') { throw result }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
const result = stringify(list.toArray(encoding.toCodePointList([55296, 56320, 55297, 56375, 55378, 57186, 56319, 57343])))
|
|
26
|
-
if (result !== '[65536,66615,150370,1114111]') { throw result }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
const result = stringify(list.toArray(encoding.toCodePointList([55296, 55296])))
|
|
31
|
-
if (result !== '[-2147428352,-2147428352]') { throw result }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
const result = stringify(list.toArray(encoding.toCodePointList([55296, 0])))
|
|
36
|
-
if (result !== '[-2147428352,0]') { throw result }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
const result = stringify(list.toArray(encoding.toCodePointList([56320])))
|
|
41
|
-
if (result !== '[-2147427328]') { throw result }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
const result = stringify(list.toArray(encoding.toCodePointList([56320, 0])))
|
|
46
|
-
if (result !== '[-2147427328,0]') { throw result }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0])))
|
|
51
|
-
if (result !== '[0]') { throw result }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x24])))
|
|
56
|
-
if (result !== '[36]') { throw result }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x20AC])))
|
|
61
|
-
if (result !== '[8364]') { throw result }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0xd7ff])))
|
|
66
|
-
if (result !== '[55295]') { throw result }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0xe000])))
|
|
71
|
-
if (result !== '[57344]') { throw result }
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0xffff])))
|
|
76
|
-
if (result !== '[65535]') { throw result }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10000])))
|
|
81
|
-
if (result !== '[55296,56320]') { throw result }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10437])))
|
|
86
|
-
if (result !== '[55297,56375]') { throw result }
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x24B62])))
|
|
91
|
-
if (result !== '[55378,57186]') { throw result }
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10ffff])))
|
|
96
|
-
if (result !== '[56319,57343]') { throw result }
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([-1, 0xd800, 0xdfff, 0x110000])))
|
|
101
|
-
if (result !== '[65535,55296,57343,0]') { throw result }
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
const utf16List = encoding.stringToList("Hello world!😂🚜🚲")
|
|
106
|
-
const result = encoding.listToString(utf16List)
|
|
107
|
-
if (result !== "Hello world!😂🚜🚲") { throw result }
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
const a = encoding.stringToList("Hello world!😂🚜🚲")
|
|
112
|
-
const b = encoding.toCodePointList(a)
|
|
113
|
-
const c = encoding.fromCodePointList(b)
|
|
114
|
-
const result = encoding.listToString(c)
|
|
115
|
-
if (result !== "Hello world!😂🚜🚲") { throw result }
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
module.exports = {}
|
package/text/utf8/test.f.cjs
CHANGED
|
@@ -6,139 +6,120 @@ const { list } = require('../../types/module.f.cjs')
|
|
|
6
6
|
/** @type {(a: readonly json.Unknown[]) => string} */
|
|
7
7
|
const stringify = a => json.stringify(sort)(a)
|
|
8
8
|
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
module.exports = {
|
|
10
|
+
toCodePoint: [
|
|
11
|
+
() => {
|
|
12
|
+
const result = stringify(list.toArray(encoding.toCodePointList([-1, 256])))
|
|
13
|
+
if (result !== '[2147483648,2147483648]') { throw result }
|
|
14
|
+
},
|
|
15
|
+
() => {
|
|
16
|
+
const result = stringify(list.toArray(encoding.toCodePointList([128, 193, 245, 255])))
|
|
17
|
+
if (result !== '[-2147483520,-2147483455,-2147483403,-2147483393]') { throw result }
|
|
18
|
+
},
|
|
19
|
+
() => {
|
|
20
|
+
const result = stringify(list.toArray(encoding.toCodePointList([0, 1, 127])))
|
|
21
|
+
if (result !== '[0,1,127]') { throw result }
|
|
22
|
+
},
|
|
23
|
+
() => {
|
|
24
|
+
const result = stringify(list.toArray(encoding.toCodePointList([194, 128, 194, 169, 223, 191])))
|
|
25
|
+
if (result !== '[128,169,2047]') { throw result }
|
|
26
|
+
},
|
|
27
|
+
() => {
|
|
28
|
+
const result = stringify(list.toArray(encoding.toCodePointList([194, 194, 127, 194, 192, 194])))
|
|
29
|
+
if (result !== '[-2147483454,-2147483454,127,-2147483454,-2147483456,-2147483454]') { throw result }
|
|
30
|
+
},
|
|
31
|
+
() => {
|
|
32
|
+
const result = stringify(list.toArray(encoding.toCodePointList([224, 160, 128, 224, 160, 129, 239, 191, 191])))
|
|
33
|
+
if (result !== '[2048,2049,65535]') { throw result }
|
|
34
|
+
},
|
|
35
|
+
() => {
|
|
36
|
+
const result = stringify(list.toArray(encoding.toCodePointList([224, 224, 160, 127, 239, 191])))
|
|
37
|
+
if (result !== '[-2147483424,-2147482592,127,-2147481601]') { throw result }
|
|
38
|
+
},
|
|
39
|
+
() => {
|
|
40
|
+
const result = stringify(list.toArray(encoding.toCodePointList([240, 144, 128, 128, 240, 144, 128, 129, 244, 143, 191, 191])))
|
|
41
|
+
if (result !== '[65536,65537,1114111]') { throw result }
|
|
42
|
+
},
|
|
43
|
+
() => {
|
|
44
|
+
const result = stringify(list.toArray(encoding.toCodePointList([240, 240, 160, 127, 244, 191])))
|
|
45
|
+
if (result !== '[-2147483408,-2147483104,127,-2147482817]') { throw result }
|
|
46
|
+
},
|
|
47
|
+
() => {
|
|
48
|
+
const result = stringify(list.toArray(encoding.toCodePointList([240, 160, 160, 244, 160, 160])))
|
|
49
|
+
if (result !== '[-2147448800,-2147432416]') { throw result }
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
fromCodePointList: [
|
|
53
|
+
() => {
|
|
54
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0, 1, 0x7F])))
|
|
55
|
+
if (result !== '[0,1,127]') { throw result }
|
|
56
|
+
},
|
|
57
|
+
() => {
|
|
58
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x80])))
|
|
59
|
+
if (result !== '[194,128]') { throw result }
|
|
60
|
+
},
|
|
61
|
+
() => {
|
|
62
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0xa9])))
|
|
63
|
+
if (result !== '[194,169]') { throw result }
|
|
64
|
+
},
|
|
65
|
+
() => {
|
|
66
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x7ff])))
|
|
67
|
+
if (result !== '[223,191]') { throw result }
|
|
68
|
+
},
|
|
69
|
+
() => {
|
|
70
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x800])))
|
|
71
|
+
if (result !== '[224,160,128]') { throw result }
|
|
72
|
+
},
|
|
73
|
+
() => {
|
|
74
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x801])))
|
|
75
|
+
if (result !== '[224,160,129]') { throw result }
|
|
76
|
+
},
|
|
77
|
+
() => {
|
|
78
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0xffff])))
|
|
79
|
+
if (result !== '[239,191,191]') { throw result }
|
|
80
|
+
},
|
|
81
|
+
() => {
|
|
82
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10000])))
|
|
83
|
+
if (result !== '[240,144,128,128]') { throw result }
|
|
84
|
+
},
|
|
85
|
+
() => {
|
|
86
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10001])))
|
|
87
|
+
if (result !== '[240,144,128,129]') { throw result }
|
|
88
|
+
},
|
|
89
|
+
() => {
|
|
90
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x10FFFF])))
|
|
91
|
+
if (result !== '[244,143,191,191]') { throw result }
|
|
92
|
+
},
|
|
93
|
+
() => {
|
|
94
|
+
const result = stringify(list.toArray(encoding.fromCodePointList([0x110000, 2147483648])))
|
|
95
|
+
if (result !== '[2147483648,2147483648]') { throw result }
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
toFrom: [
|
|
99
|
+
() => {
|
|
100
|
+
const codePointList = encoding.toCodePointList([128, 193, 245, 255])
|
|
101
|
+
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
102
|
+
if (result !== '[128,193,245,255]') { throw result }
|
|
103
|
+
},
|
|
104
|
+
() => {
|
|
105
|
+
const codePointList = encoding.toCodePointList([194, 194, 127, 194, 192, 194])
|
|
106
|
+
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
107
|
+
if (result !== '[194,194,127,194,192,194]') { throw result }
|
|
108
|
+
},
|
|
109
|
+
() => {
|
|
110
|
+
const codePointList = encoding.toCodePointList([224, 224, 160, 127, 239, 191])
|
|
111
|
+
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
112
|
+
if (result !== '[224,224,160,127,239,191]') { throw result }
|
|
113
|
+
},
|
|
114
|
+
() => {
|
|
115
|
+
const codePointList = encoding.toCodePointList([240, 240, 160, 127, 244, 191])
|
|
116
|
+
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
117
|
+
if (result !== '[240,240,160,127,244,191]') { throw result }
|
|
118
|
+
},
|
|
119
|
+
() => {
|
|
120
|
+
const codePointList = encoding.toCodePointList([240, 160, 160, 244, 160, 160])
|
|
121
|
+
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
122
|
+
if (result !== '[240,160,160,244,160,160]') { throw result }
|
|
123
|
+
}
|
|
124
|
+
]
|
|
12
125
|
}
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
const result = stringify(list.toArray(encoding.toCodePointList([128, 193, 245, 255])))
|
|
16
|
-
if (result !== '[-2147483520,-2147483455,-2147483403,-2147483393]') { throw result }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
const result = stringify(list.toArray(encoding.toCodePointList([0, 1, 127])))
|
|
21
|
-
if (result !== '[0,1,127]') { throw result }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
const result = stringify(list.toArray(encoding.toCodePointList([194, 128, 194, 169, 223, 191])))
|
|
26
|
-
if (result !== '[128,169,2047]') { throw result }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
const result = stringify(list.toArray(encoding.toCodePointList([194, 194, 127, 194, 192, 194])))
|
|
31
|
-
if (result !== '[-2147483454,-2147483454,127,-2147483454,-2147483456,-2147483454]') { throw result }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
const result = stringify(list.toArray(encoding.toCodePointList([224, 160, 128, 224, 160, 129, 239, 191, 191])))
|
|
36
|
-
if (result !== '[2048,2049,65535]') { throw result }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
const result = stringify(list.toArray(encoding.toCodePointList([224, 224, 160, 127, 239, 191])))
|
|
41
|
-
if (result !== '[-2147483424,-2147482592,127,-2147481601]') { throw result }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
const result = stringify(list.toArray(encoding.toCodePointList([240, 144, 128, 128, 240, 144, 128, 129, 244, 143, 191, 191])))
|
|
46
|
-
if (result !== '[65536,65537,1114111]') { throw result }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
const result = stringify(list.toArray(encoding.toCodePointList([240, 240, 160, 127, 244, 191])))
|
|
51
|
-
if (result !== '[-2147483408,-2147483104,127,-2147482817]') { throw result }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
const result = stringify(list.toArray(encoding.toCodePointList([240, 160, 160, 244, 160, 160])))
|
|
56
|
-
if (result !== '[-2147448800,-2147432416]') { throw result }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0,1,0x7F])))
|
|
61
|
-
if (result !== '[0,1,127]') { throw result }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x80])))
|
|
66
|
-
if (result !== '[194,128]') { throw result }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0xa9])))
|
|
71
|
-
if (result !== '[194,169]') { throw result }
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x7ff])))
|
|
76
|
-
if (result !== '[223,191]') { throw result }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x800])))
|
|
81
|
-
if (result !== '[224,160,128]') { throw result }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x801])))
|
|
86
|
-
if (result !== '[224,160,129]') { throw result }
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0xffff])))
|
|
91
|
-
if (result !== '[239,191,191]') { throw result }
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10000])))
|
|
96
|
-
if (result !== '[240,144,128,128]') { throw result }
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10001])))
|
|
101
|
-
if (result !== '[240,144,128,129]') { throw result }
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x10FFFF])))
|
|
106
|
-
if (result !== '[244,143,191,191]') { throw result }
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
{
|
|
110
|
-
const result = stringify(list.toArray(encoding.fromCodePointList([0x110000,2147483648])))
|
|
111
|
-
if (result !== '[2147483648,2147483648]') { throw result }
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
const codePointList = encoding.toCodePointList([128, 193, 245, 255])
|
|
116
|
-
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
117
|
-
if (result !== '[128,193,245,255]') { throw result }
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
const codePointList = encoding.toCodePointList([194, 194, 127, 194, 192, 194])
|
|
122
|
-
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
123
|
-
if (result !== '[194,194,127,194,192,194]') { throw result }
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
const codePointList = encoding.toCodePointList([224, 224, 160, 127, 239, 191])
|
|
128
|
-
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
129
|
-
if (result !== '[224,224,160,127,239,191]') { throw result }
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
const codePointList = encoding.toCodePointList([240, 240, 160, 127, 244, 191])
|
|
134
|
-
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
135
|
-
if (result !== '[240,240,160,127,244,191]') { throw result }
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
{
|
|
139
|
-
const codePointList = encoding.toCodePointList([240, 160, 160, 244, 160, 160])
|
|
140
|
-
const result = stringify(list.toArray(encoding.fromCodePointList(codePointList)))
|
|
141
|
-
if (result !== '[240,160,160,244,160,160]') { throw result }
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
module.exports = {}
|