util: change inspect compact and breakLength default · nodejs/node@c9fece3 (original) (raw)
`@@ -165,59 +165,74 @@ assert.strictEqual(util.format('%o', 42), '42');
`
165
165
`assert.strictEqual(util.format('%o', 'foo'), ''foo'');
`
166
166
`assert.strictEqual(
`
167
167
`util.format('%o', obj),
`
168
``
`-
'{ foo: 'bar',\n' +
`
``
168
`+
'{\n' +
`
``
169
`+
' foo: 'bar',\n' +
`
169
170
`' foobar: 1,\n' +
`
170
``
`-
' func:\n' +
`
171
``
`-
' { [Function: func]\n' +
`
172
``
`-
' [length]: 0,\n' +
`
173
``
`-
' [name]: 'func',\n' +
`
174
``
`-
' [prototype]: func { [constructor]: [Circular] } } }');
`
``
171
`+
' func: [Function: func] {\n' +
`
``
172
`+
' [length]: 0,\n' +
`
``
173
`+
' [name]: 'func',\n' +
`
``
174
`+
' [prototype]: func { [constructor]: [Circular] }\n' +
`
``
175
`+
' }\n' +
`
``
176
`+
'}');
`
175
177
`assert.strictEqual(
`
176
178
`util.format('%o', nestedObj2),
`
177
``
`-
'{ foo: 'bar',\n' +
`
``
179
`+
'{\n' +
`
``
180
`+
' foo: 'bar',\n' +
`
178
181
`' foobar: 1,\n' +
`
179
``
`-
' func:\n' +
`
180
``
`-
' [ { a:\n' +
`
181
``
`-
' { [Function: a]\n' +
`
182
``
`-
' [length]: 0,\n' +
`
183
``
`-
' [name]: 'a',\n' +
`
184
``
`-
' [prototype]: a { [constructor]: [Circular] } } },\n' +
`
185
``
`-
' [length]: 1 ] }');
`
``
182
`+
' func: [\n' +
`
``
183
`+
' {\n' +
`
``
184
`+
' a: [Function: a] {\n' +
`
``
185
`+
' [length]: 0,\n' +
`
``
186
`+
' [name]: 'a',\n' +
`
``
187
`+
' [prototype]: a { [constructor]: [Circular] }\n' +
`
``
188
`+
' }\n' +
`
``
189
`+
' },\n' +
`
``
190
`+
' [length]: 1\n' +
`
``
191
`+
' ]\n' +
`
``
192
`+
'}');
`
186
193
`assert.strictEqual(
`
187
194
`util.format('%o', nestedObj),
`
188
``
`-
'{ foo: 'bar',\n' +
`
189
``
`-
' foobar:\n' +
`
190
``
`-
' { foo: 'bar',\n' +
`
191
``
`-
' func:\n' +
`
192
``
`-
' { [Function: func]\n' +
`
193
``
`-
' [length]: 0,\n' +
`
194
``
`-
' [name]: 'func',\n' +
`
195
``
`-
' [prototype]: func { [constructor]: [Circular] } } } }');
`
``
195
`+
'{\n' +
`
``
196
`+
' foo: 'bar',\n' +
`
``
197
`+
' foobar: {\n' +
`
``
198
`+
' foo: 'bar',\n' +
`
``
199
`+
' func: [Function: func] {\n' +
`
``
200
`+
' [length]: 0,\n' +
`
``
201
`+
' [name]: 'func',\n' +
`
``
202
`+
' [prototype]: func { [constructor]: [Circular] }\n' +
`
``
203
`+
' }\n' +
`
``
204
`+
' }\n' +
`
``
205
`+
'}');
`
196
206
`assert.strictEqual(
`
197
207
`util.format('%o %o', obj, obj),
`
198
``
`-
'{ foo: 'bar',\n' +
`
``
208
`+
'{\n' +
`
``
209
`+
' foo: 'bar',\n' +
`
199
210
`' foobar: 1,\n' +
`
200
``
`-
' func:\n' +
`
201
``
`-
' { [Function: func]\n' +
`
202
``
`-
' [length]: 0,\n' +
`
203
``
`-
' [name]: 'func',\n' +
`
204
``
`-
' [prototype]: func { [constructor]: [Circular] } } }' +
`
205
``
`-
' { foo: 'bar',\n' +
`
``
211
`+
' func: [Function: func] {\n' +
`
``
212
`+
' [length]: 0,\n' +
`
``
213
`+
' [name]: 'func',\n' +
`
``
214
`+
' [prototype]: func { [constructor]: [Circular] }\n' +
`
``
215
`+
' }\n' +
`
``
216
`+
'} {\n' +
`
``
217
`+
' foo: 'bar',\n' +
`
206
218
`' foobar: 1,\n' +
`
207
``
`-
' func:\n' +
`
208
``
`-
' { [Function: func]\n' +
`
209
``
`-
' [length]: 0,\n' +
`
210
``
`-
' [name]: 'func',\n' +
`
211
``
`-
' [prototype]: func { [constructor]: [Circular] } } }');
`
``
219
`+
' func: [Function: func] {\n' +
`
``
220
`+
' [length]: 0,\n' +
`
``
221
`+
' [name]: 'func',\n' +
`
``
222
`+
' [prototype]: func { [constructor]: [Circular] }\n' +
`
``
223
`+
' }\n' +
`
``
224
`+
'}');
`
212
225
`assert.strictEqual(
`
213
226
`util.format('%o %o', obj),
`
214
``
`-
'{ foo: 'bar',\n' +
`
``
227
`+
'{\n' +
`
``
228
`+
' foo: 'bar',\n' +
`
215
229
`' foobar: 1,\n' +
`
216
``
`-
' func:\n' +
`
217
``
`-
' { [Function: func]\n' +
`
218
``
`-
' [length]: 0,\n' +
`
219
``
`-
' [name]: 'func',\n' +
`
220
``
`-
' [prototype]: func { [constructor]: [Circular] } } } %o');
`
``
230
`+
' func: [Function: func] {\n' +
`
``
231
`+
' [length]: 0,\n' +
`
``
232
`+
' [name]: 'func',\n' +
`
``
233
`+
' [prototype]: func { [constructor]: [Circular] }\n' +
`
``
234
`+
' }\n' +
`
``
235
`+
'} %o');
`
221
236
``
222
237
`assert.strictEqual(util.format('%O'), '%O');
`
223
238
`assert.strictEqual(util.format('%O', 42), '42');
`