File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,15 @@ test.snapshot({
79
79
'a = {[`a\\\\b${foo}cd${foo.bar}e\\\\f`]: b}' ,
80
80
'a = `a${foo}${foo.bar}b\\\\c`' ,
81
81
'a = `a\\\\b${"c\\\\d"}e`' ,
82
+ outdent `
83
+ a = \`\\\\a
84
+ b\`
85
+ ` ,
86
+ outdent `
87
+ a = \`\\\\a\${foo}
88
+ b\${bar}c
89
+ d\\\\\\\\e\`
90
+ ` ,
82
91
] ,
83
92
} ) ;
84
93
Original file line number Diff line number Diff line change @@ -241,3 +241,57 @@ Generated by [AVA](https://avajs.dev).
241
241
> 1 | a = \`a\\\\b${"c\\\\d"}e\`␊
242
242
| ^^^^^^ \`String.raw\` should be used to avoid escaping \`\\\`.␊
243
243
`
244
+
245
+ ## invalid(6): a = ` \\a b `
246
+
247
+ > Input
248
+
249
+ `␊
250
+ 1 | a = \`\\\\a␊
251
+ 2 | b\`␊
252
+ `
253
+
254
+ > Output
255
+
256
+ `␊
257
+ 1 | a = String.raw\`\\a␊
258
+ 2 | b\`␊
259
+ `
260
+
261
+ > Error 1/1
262
+
263
+ `␊
264
+ > 1 | a = \`\\\\a␊
265
+ | ^^^^␊
266
+ > 2 | b\`␊
267
+ | ^^^ \`String.raw\` should be used to avoid escaping \`\\\`.␊
268
+ `
269
+
270
+ ## invalid(7): a = ` \\a${foo} b${bar}c d\\\\e `
271
+
272
+ > Input
273
+
274
+ `␊
275
+ 1 | a = \`\\\\a${foo}␊
276
+ 2 | b${bar}c␊
277
+ 3 | d\\\\\\\\e\`␊
278
+ `
279
+
280
+ > Output
281
+
282
+ `␊
283
+ 1 | a = String.raw\`\\a${foo}␊
284
+ 2 | b${bar}c␊
285
+ 3 | d\\\\e\`␊
286
+ `
287
+
288
+ > Error 1/1
289
+
290
+ `␊
291
+ > 1 | a = \`\\\\a${foo}␊
292
+ | ^^^^^^^^^^␊
293
+ > 2 | b${bar}c␊
294
+ | ^^^^^^^^␊
295
+ > 3 | d\\\\\\\\e\`␊
296
+ | ^^^^^^^^ \`String.raw\` should be used to avoid escaping \`\\\`.␊
297
+ `
You can’t perform that action at this time.
0 commit comments