Skip to content

Commit 814248a

Browse files
jenthonemeixg
authored andcommitted
test: add string-keyed object case
1 parent 13b2c53 commit 814248a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/parallel/test-repl-preview.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,22 @@ async function tests(options) {
191191
"{ a: '{' }\r",
192192
"{ a: \x1B[32m'{'\x1B[39m }",
193193
],
194+
}, {
195+
input: "{'{':0}",
196+
noPreview: "{ \x1B[32m'{'\x1B[39m: \x1B[33m0\x1B[39m }",
197+
preview: [
198+
"{'{':0}",
199+
"\x1B[90m{ '{': 0 }\x1B[39m\x1B[15G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r",
200+
"{ \x1B[32m'{'\x1B[39m: \x1B[33m0\x1B[39m }",
201+
],
202+
}, {
203+
input: '{[Symbol.for("{")]: 0 }',
204+
noPreview: '{ [\x1B[32mSymbol({)\x1B[39m]: \x1B[33m0\x1B[39m }',
205+
preview: [
206+
// eslint-disable-next-line max-len
207+
'{[Sym\x1B[90mbol\x1B[39m\x1B[13G\x1B[0Kb\x1B[90mol\x1B[39m\x1B[14G\x1B[0Ko\x1B[90ml\x1B[39m\x1B[15G\x1B[0Kl.for("{")]: 0 }\r',
208+
'{ [\x1B[32mSymbol({)\x1B[39m]: \x1B[33m0\x1B[39m }',
209+
],
194210
}];
195211

196212
const hasPreview = repl.terminal &&

0 commit comments

Comments
 (0)