@@ -219,15 +219,19 @@ printWidth: 80
219219
220220// Emoji.
221221("🐶");
222+
222223// Empty string.
223224("");
224225("");
226+
225227// Single double quote.
226228('"');
227229('"');
230+
228231// Single single quote.
229232("'");
230233("'");
234+
231235// Unnecessary escapes.
232236("'");
233237('"');
@@ -246,6 +250,7 @@ printWidth: 80
246250("aa"); // consecutive unnecessarily escaped characters
247251("aa"); // consecutive unnecessarily escaped characters
248252("escaped \\ u2030 ‰ (should not stay escaped)");
253+
249254// Meaningful escapes
250255("octal escapes \\ 0 \\ 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7");
251256("octal escapes \\ 0 \\ 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7");
@@ -257,30 +262,39 @@ printWidth: 80
257262");
258263("escaped \\ u2028 \\
");
259264("escaped \\ u2029 \\
");
265+
260266// One of each.
261267("\\ "'");
262268("\\ "'");
269+
263270// One of each with unnecessary escapes.
264271("\\ "'");
265272("\\ "'");
273+
266274// More double quotes than single quotes.
267275('"\\ '"');
268276('"\\ '"');
277+
269278// More single quotes than double quotes.
270279("\\ "''");
271280("\\ "''");
281+
272282// Two of each.
273283("\\ "\\ "''");
274284("\\ "\\ "''");
285+
275286// Single backslash.
276287("\\\\ ");
277288("\\\\ ");
289+
278290// Backslases.
279291("\\ "\\\\\\ "\\\\\\\\\\ " ''\\\\ '\\\\ '\\\\\\\\ '");
280292('\\ '\\\\\\ '\\\\\\\\\\ ' ""\\\\ "\\\\ "\\\\\\\\ "');
293+
281294// Somewhat more real-word example.
282295("He's sayin': \\ "How's it goin'?\\ " Don't ask me why.");
283296("He's sayin': \\ "How's it goin'?\\ " Don't ask me why.");
297+
284298// Somewhat more real-word example 2.
285299('var backslash = "\\\\ ", doubleQuote = \\ '"\\ ';');
286300('var backslash = "\\\\ ", doubleQuote = \\ '"\\ ';');
@@ -418,15 +432,19 @@ singleQuote: true
418432
419433// Emoji.
420434('🐶');
435+
421436// Empty string.
422437('');
423438('');
439+
424440// Single double quote.
425441('"');
426442('"');
443+
427444// Single single quote.
428445("'");
429446("'");
447+
430448// Unnecessary escapes.
431449("'");
432450('"');
@@ -445,6 +463,7 @@ singleQuote: true
445463('aa'); // consecutive unnecessarily escaped characters
446464('aa'); // consecutive unnecessarily escaped characters
447465('escaped \\ u2030 ‰ (should not stay escaped)');
466+
448467// Meaningful escapes
449468('octal escapes \\ 0 \\ 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7');
450469('octal escapes \\ 0 \\ 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7');
@@ -456,30 +475,39 @@ singleQuote: true
456475');
457476('escaped \\ u2028 \\
');
458477('escaped \\ u2029 \\
');
478+
459479// One of each.
460480('"\\ '');
461481('"\\ '');
482+
462483// One of each with unnecessary escapes.
463484('"\\ '');
464485('"\\ '');
486+
465487// More double quotes than single quotes.
466488('"\\ '"');
467489('"\\ '"');
490+
468491// More single quotes than double quotes.
469492("\\ "''");
470493("\\ "''");
494+
471495// Two of each.
472496('""\\ '\\ '');
473497('""\\ '\\ '');
498+
474499// Single backslash.
475500('\\\\ ');
476501('\\\\ ');
502+
477503// Backslases.
478504("\\ "\\\\\\ "\\\\\\\\\\ " ''\\\\ '\\\\ '\\\\\\\\ '");
479505('\\ '\\\\\\ '\\\\\\\\\\ ' ""\\\\ "\\\\ "\\\\\\\\ "');
506+
480507// Somewhat more real-word example.
481508("He's sayin': \\ "How's it goin'?\\ " Don't ask me why.");
482509("He's sayin': \\ "How's it goin'?\\ " Don't ask me why.");
510+
483511// Somewhat more real-word example 2.
484512('var backslash = "\\\\ ", doubleQuote = \\ '"\\ ';');
485513('var backslash = "\\\\ ", doubleQuote = \\ '"\\ ';');
0 commit comments