Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imteekay committed Apr 28, 2023
1 parent c5e8220 commit ead71e2
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 6 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tests/**/*
2 changes: 1 addition & 1 deletion baselines/reference/stringLIteral.js.baseline
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"var singleQuote = 'singleQuote';\nvar doubleQuote = \"doubleQuote\""
"var singleQuote = 'singleQuote';\nvar doubleQuote = \"doubleQuote\";\nvar escapedSingleQuote = 'escapedSingle\\'Quote';\nvar escapedDoubleQuote = \"escapedDouble\\\"Quote\";\n(missing)"
118 changes: 114 additions & 4 deletions baselines/reference/stringLIteral.tree.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,42 @@
"kind": "Var",
"pos": 36
}
],
"escapedSingleQuote": [
{
"kind": "Var",
"pos": 69
}
],
"escapedDoubleQuote": [
{
"kind": "Var",
"pos": 118
}
],
"escapedB": [
{
"kind": "Var",
"pos": 167
}
],
"escapedT": [
{
"kind": "Var",
"pos": 196
}
],
"escapedN": [
{
"kind": "Var",
"pos": 225
}
],
"escapedR": [
{
"kind": "Var",
"pos": 254
}
]
},
"statements": [
Expand All @@ -21,8 +57,9 @@
"text": "singleQuote"
},
"init": {
"kind": "Literal",
"value": "singleQuote"
"kind": "StringLiteral",
"value": "singleQuote",
"isSingleQuote": true
}
},
{
Expand All @@ -32,8 +69,81 @@
"text": "doubleQuote"
},
"init": {
"kind": "Literal",
"value": "double'Quote"
"kind": "StringLiteral",
"value": "doubleQuote",
"isSingleQuote": false
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedSingleQuote"
},
"init": {
"kind": "StringLiteral",
"value": "escapedSingle'Quote",
"isSingleQuote": true
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedDoubleQuote"
},
"init": {
"kind": "StringLiteral",
"value": "escapedDouble\"Quote",
"isSingleQuote": false
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedB"
},
"init": {
"kind": "StringLiteral",
"value": "escaped\nB",
"isSingleQuote": true
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedT"
},
"init": {
"kind": "StringLiteral",
"value": "escaped\nT",
"isSingleQuote": true
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedN"
},
"init": {
"kind": "StringLiteral",
"value": "escaped\nN",
"isSingleQuote": true
}
},
{
"kind": "Var",
"name": {
"kind": "Identifier",
"text": "escapedR"
},
"init": {
"kind": "StringLiteral",
"value": "escaped\nR",
"isSingleQuote": true
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion tests/stringLiteral.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
var singleQuote = 'singleQuote';
var doubleQuote = 'double\'Quote';
var doubleQuote = "doubleQuote";
var escapedSingleQuote = 'escapedSingle\'Quote';
var escapedDoubleQuote = "escapedDouble\"Quote";
var escapedB = 'escaped\nB';
var escapedT = 'escaped\nT';
var escapedN = 'escaped\nN';
var escapedR = 'escaped\nR';

0 comments on commit ead71e2

Please sign in to comment.