Skip to content

Commit

Permalink
Add tests for escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Jun 6, 2020
1 parent 8219665 commit 3818eb6
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/flow/quote-props/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -257,6 +263,12 @@ const b = {
b: "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
c2: "c2",
Expand Down Expand Up @@ -320,6 +332,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -373,6 +391,12 @@ const b = {
b: 'b',
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': 'b',
'\\u0031': '1',
};
const c = {
c1: 'c1',
c2: 'c2',
Expand Down Expand Up @@ -435,6 +459,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -488,6 +518,12 @@ const b = {
b: "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
c2: "c2",
Expand Down Expand Up @@ -550,6 +586,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -603,6 +645,12 @@ const b = {
"b": "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
"c2": "c2",
Expand Down
6 changes: 6 additions & 0 deletions tests/flow/quote-props/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const b = {
'b': "b"
};

const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\u0062': "b",
'\u0031': "1"
};

const c = {
c1: "c1",
'c2': "c2"
Expand Down
48 changes: 48 additions & 0 deletions tests/js/quote-props/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -257,6 +263,12 @@ const b = {
b: "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
c2: "c2",
Expand Down Expand Up @@ -320,6 +332,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -373,6 +391,12 @@ const b = {
b: 'b',
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': 'b',
'\\u0031': '1',
};
const c = {
c1: 'c1',
c2: 'c2',
Expand Down Expand Up @@ -435,6 +459,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -488,6 +518,12 @@ const b = {
b: "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
c2: "c2",
Expand Down Expand Up @@ -550,6 +586,12 @@ const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\\u0062': "b",
'\\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
Expand Down Expand Up @@ -603,6 +645,12 @@ const b = {
"b": "b",
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
"\\u0062": "b",
"\\u0031": "1",
};
const c = {
c1: "c1",
"c2": "c2",
Expand Down
6 changes: 6 additions & 0 deletions tests/js/quote-props/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const b = {
'b': "b"
};

const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\u0062': "b",
'\u0031': "1"
};

const c = {
c1: "c1",
'c2': "c2"
Expand Down

0 comments on commit 3818eb6

Please sign in to comment.