@@ -38,124 +38,124 @@ test([1, 2, 3], `
38
38
┌─────────┬────────┐
39
39
│ (index) │ Values │
40
40
├─────────┼────────┤
41
- │ 0 │ 1 │
42
- │ 1 │ 2 │
43
- │ 2 │ 3 │
41
+ │ 0 │ 1 │
42
+ │ 1 │ 2 │
43
+ │ 2 │ 3 │
44
44
└─────────┴────────┘
45
45
` ) ;
46
46
47
47
test ( [ Symbol ( ) , 5 , [ 10 ] ] , `
48
48
┌─────────┬────┬──────────┐
49
- │ (index) │ 0 │ Values │
49
+ │ (index) │ 0 │ Values │
50
50
├─────────┼────┼──────────┤
51
- │ 0 │ │ Symbol() │
52
- │ 1 │ │ 5 │
53
- │ 2 │ 10 │ │
51
+ │ 0 │ │ Symbol() │
52
+ │ 1 │ │ 5 │
53
+ │ 2 │ 10 │ │
54
54
└─────────┴────┴──────────┘
55
55
` ) ;
56
56
57
57
test ( [ null , 5 ] , `
58
58
┌─────────┬────────┐
59
59
│ (index) │ Values │
60
60
├─────────┼────────┤
61
- │ 0 │ null │
62
- │ 1 │ 5 │
61
+ │ 0 │ null │
62
+ │ 1 │ 5 │
63
63
└─────────┴────────┘
64
64
` ) ;
65
65
66
66
test ( [ undefined , 5 ] , `
67
67
┌─────────┬───────────┐
68
- │ (index) │ Values │
68
+ │ (index) │ Values │
69
69
├─────────┼───────────┤
70
- │ 0 │ undefined │
71
- │ 1 │ 5 │
70
+ │ 0 │ undefined │
71
+ │ 1 │ 5 │
72
72
└─────────┴───────────┘
73
73
` ) ;
74
74
75
75
test ( { a : 1 , b : Symbol ( ) , c : [ 10 ] } , `
76
76
┌─────────┬────┬──────────┐
77
- │ (index) │ 0 │ Values │
77
+ │ (index) │ 0 │ Values │
78
78
├─────────┼────┼──────────┤
79
- │ a │ │ 1 │
80
- │ b │ │ Symbol() │
81
- │ c │ 10 │ │
79
+ │ a │ │ 1 │
80
+ │ b │ │ Symbol() │
81
+ │ c │ 10 │ │
82
82
└─────────┴────┴──────────┘
83
83
` ) ;
84
84
85
85
test ( new Map ( [ [ 'a' , 1 ] , [ Symbol ( ) , [ 2 ] ] ] ) , `
86
86
┌───────────────────┬──────────┬────────┐
87
- │ (iteration index) │ Key │ Values │
87
+ │ (iteration index) │ Key │ Values │
88
88
├───────────────────┼──────────┼────────┤
89
- │ 0 │ 'a' │ 1 │
90
- │ 1 │ Symbol() │ [ 2 ] │
89
+ │ 0 │ 'a' │ 1 │
90
+ │ 1 │ Symbol() │ [ 2 ] │
91
91
└───────────────────┴──────────┴────────┘
92
92
` ) ;
93
93
94
94
test ( new Set ( [ 1 , 2 , Symbol ( ) ] ) , `
95
95
┌───────────────────┬──────────┐
96
- │ (iteration index) │ Values │
96
+ │ (iteration index) │ Values │
97
97
├───────────────────┼──────────┤
98
- │ 0 │ 1 │
99
- │ 1 │ 2 │
100
- │ 2 │ Symbol() │
98
+ │ 0 │ 1 │
99
+ │ 1 │ 2 │
100
+ │ 2 │ Symbol() │
101
101
└───────────────────┴──────────┘
102
102
` ) ;
103
103
104
104
test ( { a : 1 , b : 2 } , [ 'a' ] , `
105
105
┌─────────┬───┐
106
106
│ (index) │ a │
107
107
├─────────┼───┤
108
- │ a │ │
109
- │ b │ │
108
+ │ a │ │
109
+ │ b │ │
110
110
└─────────┴───┘
111
111
` ) ;
112
112
113
113
test ( [ { a : 1 , b : 2 } , { a : 3 , c : 4 } ] , [ 'a' ] , `
114
114
┌─────────┬───┐
115
115
│ (index) │ a │
116
116
├─────────┼───┤
117
- │ 0 │ 1 │
118
- │ 1 │ 3 │
117
+ │ 0 │ 1 │
118
+ │ 1 │ 3 │
119
119
└─────────┴───┘
120
120
` ) ;
121
121
122
122
test ( new Map ( [ [ 1 , 1 ] , [ 2 , 2 ] , [ 3 , 3 ] ] ) . entries ( ) , `
123
123
┌───────────────────┬─────┬────────┐
124
124
│ (iteration index) │ Key │ Values │
125
125
├───────────────────┼─────┼────────┤
126
- │ 0 │ 1 │ 1 │
127
- │ 1 │ 2 │ 2 │
128
- │ 2 │ 3 │ 3 │
126
+ │ 0 │ 1 │ 1 │
127
+ │ 1 │ 2 │ 2 │
128
+ │ 2 │ 3 │ 3 │
129
129
└───────────────────┴─────┴────────┘
130
130
` ) ;
131
131
132
132
test ( new Map ( [ [ 1 , 1 ] , [ 2 , 2 ] , [ 3 , 3 ] ] ) . values ( ) , `
133
133
┌───────────────────┬────────┐
134
134
│ (iteration index) │ Values │
135
135
├───────────────────┼────────┤
136
- │ 0 │ 1 │
137
- │ 1 │ 2 │
138
- │ 2 │ 3 │
136
+ │ 0 │ 1 │
137
+ │ 1 │ 2 │
138
+ │ 2 │ 3 │
139
139
└───────────────────┴────────┘
140
140
` ) ;
141
141
142
142
test ( new Map ( [ [ 1 , 1 ] , [ 2 , 2 ] , [ 3 , 3 ] ] ) . keys ( ) , `
143
143
┌───────────────────┬────────┐
144
144
│ (iteration index) │ Values │
145
145
├───────────────────┼────────┤
146
- │ 0 │ 1 │
147
- │ 1 │ 2 │
148
- │ 2 │ 3 │
146
+ │ 0 │ 1 │
147
+ │ 1 │ 2 │
148
+ │ 2 │ 3 │
149
149
└───────────────────┴────────┘
150
150
` ) ;
151
151
152
152
test ( new Set ( [ 1 , 2 , 3 ] ) . values ( ) , `
153
153
┌───────────────────┬────────┐
154
154
│ (iteration index) │ Values │
155
155
├───────────────────┼────────┤
156
- │ 0 │ 1 │
157
- │ 1 │ 2 │
158
- │ 2 │ 3 │
156
+ │ 0 │ 1 │
157
+ │ 1 │ 2 │
158
+ │ 2 │ 3 │
159
159
└───────────────────┴────────┘
160
160
` ) ;
161
161
@@ -164,61 +164,61 @@ test({ a: { a: 1, b: 2, c: 3 } }, `
164
164
┌─────────┬───┬───┬───┐
165
165
│ (index) │ a │ b │ c │
166
166
├─────────┼───┼───┼───┤
167
- │ a │ 1 │ 2 │ 3 │
167
+ │ a │ 1 │ 2 │ 3 │
168
168
└─────────┴───┴───┴───┘
169
169
` ) ;
170
170
171
171
test ( { a : { a : { a : 1 , b : 2 , c : 3 } } } , `
172
172
┌─────────┬──────────┐
173
- │ (index) │ a │
173
+ │ (index) │ a │
174
174
├─────────┼──────────┤
175
- │ a │ [Object] │
175
+ │ a │ [Object] │
176
176
└─────────┴──────────┘
177
177
` ) ;
178
178
179
179
test ( { a : [ 1 , 2 ] } , `
180
180
┌─────────┬───┬───┐
181
181
│ (index) │ 0 │ 1 │
182
182
├─────────┼───┼───┤
183
- │ a │ 1 │ 2 │
183
+ │ a │ 1 │ 2 │
184
184
└─────────┴───┴───┘
185
185
` ) ;
186
186
187
187
test ( { a : [ 1 , 2 , 3 , 4 , 5 ] , b : 5 , c : { e : 5 } } , `
188
188
┌─────────┬───┬───┬───┬───┬───┬───┬────────┐
189
189
│ (index) │ 0 │ 1 │ 2 │ 3 │ 4 │ e │ Values │
190
190
├─────────┼───┼───┼───┼───┼───┼───┼────────┤
191
- │ a │ 1 │ 2 │ 3 │ 4 │ 5 │ │ │
192
- │ b │ │ │ │ │ │ │ 5 │
193
- │ c │ │ │ │ │ │ 5 │ │
191
+ │ a │ 1 │ 2 │ 3 │ 4 │ 5 │ │ │
192
+ │ b │ │ │ │ │ │ │ 5 │
193
+ │ c │ │ │ │ │ │ 5 │ │
194
194
└─────────┴───┴───┴───┴───┴───┴───┴────────┘
195
195
` ) ;
196
196
197
197
test ( new Uint8Array ( [ 1 , 2 , 3 ] ) , `
198
198
┌─────────┬────────┐
199
199
│ (index) │ Values │
200
200
├─────────┼────────┤
201
- │ 0 │ 1 │
202
- │ 1 │ 2 │
203
- │ 2 │ 3 │
201
+ │ 0 │ 1 │
202
+ │ 1 │ 2 │
203
+ │ 2 │ 3 │
204
204
└─────────┴────────┘
205
205
` ) ;
206
206
207
207
test ( Buffer . from ( [ 1 , 2 , 3 ] ) , `
208
208
┌─────────┬────────┐
209
209
│ (index) │ Values │
210
210
├─────────┼────────┤
211
- │ 0 │ 1 │
212
- │ 1 │ 2 │
213
- │ 2 │ 3 │
211
+ │ 0 │ 1 │
212
+ │ 1 │ 2 │
213
+ │ 2 │ 3 │
214
214
└─────────┴────────┘
215
215
` ) ;
216
216
217
217
test ( { a : undefined } , [ 'x' ] , `
218
218
┌─────────┬───┐
219
219
│ (index) │ x │
220
220
├─────────┼───┤
221
- │ a │ │
221
+ │ a │ │
222
222
└─────────┴───┘
223
223
` ) ;
224
224
@@ -238,23 +238,23 @@ test(new Map(), `
238
238
239
239
test ( [ { a : 1 , b : 'Y' } , { a : 'Z' , b : 2 } ] , `
240
240
┌─────────┬─────┬─────┐
241
- │ (index) │ a │ b │
241
+ │ (index) │ a │ b │
242
242
├─────────┼─────┼─────┤
243
- │ 0 │ 1 │ 'Y' │
244
- │ 1 │ 'Z' │ 2 │
243
+ │ 0 │ 1 │ 'Y' │
244
+ │ 1 │ 'Z' │ 2 │
245
245
└─────────┴─────┴─────┘
246
246
` ) ;
247
247
248
248
{
249
249
const line = '─' . repeat ( 79 ) ;
250
- const header = `${ ' ' . repeat ( 37 ) } name${ ' ' . repeat ( 40 ) } ` ;
250
+ const header = `name${ ' ' . repeat ( 77 ) } ` ;
251
251
const name = 'very long long long long long long long long long long long ' +
252
252
'long long long long' ;
253
253
test ( [ { name } ] , `
254
254
┌─────────┬──${ line } ──┐
255
- │ (index) │ ${ header } │
255
+ │ (index) │ ${ header } │
256
256
├─────────┼──${ line } ──┤
257
- │ 0 │ '${ name } ' │
257
+ │ 0 │ '${ name } ' │
258
258
└─────────┴──${ line } ──┘
259
259
` ) ;
260
260
}
@@ -263,17 +263,17 @@ test({ foo: '¥', bar: '¥' }, `
263
263
┌─────────┬────────┐
264
264
│ (index) │ Values │
265
265
├─────────┼────────┤
266
- │ foo │ '¥' │
267
- │ bar │ '¥' │
266
+ │ foo │ '¥' │
267
+ │ bar │ '¥' │
268
268
└─────────┴────────┘
269
269
` ) ;
270
270
271
271
test ( { foo : '你好' , bar : 'hello' } , `
272
272
┌─────────┬─────────┐
273
273
│ (index) │ Values │
274
274
├─────────┼─────────┤
275
- │ foo │ '你好' │
276
- │ bar │ 'hello' │
275
+ │ foo │ '你好' │
276
+ │ bar │ 'hello' │
277
277
└─────────┴─────────┘
278
278
` ) ;
279
279
@@ -285,8 +285,8 @@ test([{ foo: 10 }, { foo: 20 }], ['__proto__'], `
285
285
┌─────────┬───────────┐
286
286
│ (index) │ __proto__ │
287
287
├─────────┼───────────┤
288
- │ 0 │ │
289
- │ 1 │ │
288
+ │ 0 │ │
289
+ │ 1 │ │
290
290
└─────────┴───────────┘
291
291
` ) ;
292
292
assert . strictEqual ( '0' in Object . prototype , false ) ;
0 commit comments