Change test to workaround babylon bug (#184)

Babylon has a bug where it doesn't escape DirectiveLiteral properly. Except for `'use strict';`, this never happens in real world code, so let's put strings in a array in order to workaround this bug and have the same output on both parsers.

https://github.com/babel/babylon/issues/289
master
Christopher Chedeau 2017-01-13 20:17:02 -08:00 committed by James Long
parent d8c51483fc
commit 6f5df0e2b6
2 changed files with 51 additions and 51 deletions

View File

@ -1,46 +1,44 @@
exports[`test strings.js 1`] = `
"\"abc\"
\'abc\'
"[
\"abc\",
\'abc\',
\'\\\'\'
\'\\\'\',
\'\"\'
\'\\\"\'
\'\\\\\"\'
\'\"\',
\'\\\"\',
\'\\\\\"\',
\"\'\"
\"\\\'\"
\"\\\\\'\"
\"\'\",
\"\\\'\",
\"\\\\\'\",
\"\'\\\"\"
\'\\\'\"\'
\"\'\\\"\",
\'\\\'\"\',
\'\\\\\'
\"\\\\\"
\'\\\\\',
\"\\\\\",
\'\\0\'
\'🐶\'
\'\\0\',
\'🐶\',
];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\"abc\";
\"abc\";
\"\'\";
\'\"\';
\'\"\';
\'\\\\\"\';
\"\'\";
\"\'\";
\"\\\\\'\";
\"\'\\\"\";
\"\'\\\"\";
\"\\\\\";
\"\\\\\";
\"\\u0000\";
\"🐶\";
[
\"abc\",
\"abc\",
\"\'\",
\'\"\',
\'\"\',
\'\\\\\"\',
\"\'\",
\"\'\",
\"\\\\\'\",
\"\'\\\"\",
\"\'\\\"\",
\"\\\\\",
\"\\\\\",
\"\\u0000\",
\"🐶\"
];
"
`;

View File

@ -1,21 +1,23 @@
"abc"
'abc'
[
"abc",
'abc',
'\''
'\'',
'"'
'\"'
'\\"'
'"',
'\"',
'\\"',
"'"
"\'"
"\\'"
"'",
"\'",
"\\'",
"'\""
'\'"'
"'\"",
'\'"',
'\\'
"\\"
'\\',
"\\",
'\0'
'🐶'
'\0',
'🐶',
];