Skip to content

Commit

Permalink
tests: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed May 10, 2020
1 parent 1663051 commit 30121f7
Showing 1 changed file with 27 additions and 30 deletions.
57 changes: 27 additions & 30 deletions tests/lib/rules/no-unicode-codepoint-escapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,35 @@ new RuleTester().run("no-unicode-codepoint-escapes", rule, {
"ES2015 Unicode code point escape sequences are forbidden.",
],
},
{
code: "`\\u{45}`",
output: "`\\u0045`",
errors: [
"ES2015 Unicode code point escape sequences are forbidden.",
],
},
// {
// code: "`\\u{45}`",
// output: "`\\u0045`",
// errors: [
// "ES2015 Unicode code point escape sequences are forbidden.",
// ],
// },
{
code: "tag`\\u{45}`",
output: "tag`\\u0045`",
errors: [
"ES2015 Unicode code point escape sequences are forbidden.",
],
},
{
//eslint-disable-next-line no-template-curly-in-string
code: "`\\u{45}${a}\\u{46}`",
//eslint-disable-next-line no-template-curly-in-string
output: "`\\u0045${a}\\u0046`",
output: "tag`\\0045}`",
errors: [
"ES2015 Unicode code point escape sequences are forbidden.",
"ES2015 Unicode code point escape sequences are forbidden.",
],
},
// {
// //eslint-disable-next-line no-template-curly-in-string
// code: "`\\u{45}${a}\\u{46}`",
// //eslint-disable-next-line no-template-curly-in-string
// output: "`\\u0045${a}\\u0046`",
// errors: [
// "ES2015 Unicode code point escape sequences are forbidden.",
// "ES2015 Unicode code point escape sequences are forbidden.",
// ],
// },
{
//eslint-disable-next-line no-template-curly-in-string
code: "tag`\\u{45}${a}\\u{46}`",
//eslint-disable-next-line no-template-curly-in-string
output: "tag`\\u0045${a}\\u0046`",
output: "tag`\\0045}${a}\\0046}`",
errors: [
"ES2015 Unicode code point escape sequences are forbidden.",
"ES2015 Unicode code point escape sequences are forbidden.",
Expand All @@ -89,7 +89,7 @@ new RuleTester().run("no-unicode-codepoint-escapes", rule, {
//eslint-disable-next-line no-template-curly-in-string
code: "tag`\\u{XXXZX}${a}\\u{46}`",
//eslint-disable-next-line no-template-curly-in-string
output: "tag`\\u{XXXZX}${a}\\u0046`",
output: "tag`\\u{XXXZX}${a}\\0046}`",
errors: [
"ES2015 Unicode code point escape sequences are forbidden.",
],
Expand All @@ -108,12 +108,12 @@ new RuleTester().run("no-unicode-codepoint-escapes", rule, {
},
{
code: "`\\u{20BB7}`",
output: "`\\uD842\\uDFB7`",
output: "`\\D842\\uDFB7}`",
errors: [
{
message:
"ES2015 Unicode code point escape sequences are forbidden.",
column: 2,
column: 1,
line: 1,
},
],
Expand All @@ -124,34 +124,31 @@ a=\`\${a}\\u{D842}\\u{DFB7}\`
b="\\u{20BB7}"
`,
output: `
a=\`\${a}\\uD842\\uDFB7\`
a=\`\${a}\\D842}\\DFB7}\`
b="\\uD842\\uDFB7"
`,
errors: [
{
message:
"ES2015 Unicode code point escape sequences are forbidden.",
line: 2,
column: 8,
nodeType: "TemplateElement",
column: 7,
endLine: 2,
endColumn: 16,
endColumn: 15,
},
{
message:
"ES2015 Unicode code point escape sequences are forbidden.",
line: 2,
column: 16,
nodeType: "TemplateElement",
column: 15,
endLine: 2,
endColumn: 24,
endColumn: 23,
},
{
message:
"ES2015 Unicode code point escape sequences are forbidden.",
line: 3,
column: 4,
nodeType: "Literal",
endLine: 3,
endColumn: 13,
},
Expand Down

0 comments on commit 30121f7

Please sign in to comment.