Files
divkit/test_data/expression_test_data/string_escape.json
T
pkurchatov bf7a61674f Fixed escaped strings resolving in expressions
6c3b0bdecbf8d7b26604f66061b997048890f6e1
2024-06-07 19:45:52 +03:00

154 lines
3.8 KiB
JSON

{
"cases": [
{
"name": "string escape with alone backslash",
"expression": "\\",
"expected": {
"type": "error",
"value": "Error tokenizing '\\'."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape simple character escape",
"expression": "\\a",
"expected": {
"type": "error",
"value": "Incorrect string escape"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape backslash escape",
"expression": "\\\\",
"expected": {
"type": "string",
"value": "\\"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape quote escape",
"expression": "\\'",
"expected": {
"type": "string",
"value": "'"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape quote escape with backslash escape",
"expression": "\\\\\\'",
"expected": {
"type": "string",
"value": "\\'"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape expression escape",
"expression": "\\@{123}",
"expected": {
"type": "string",
"value": "@{123}"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape backslash with at",
"expression": "\\@",
"expected": {
"type": "error",
"value": "Incorrect string escape"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape @ without interpolation",
"expression": "a@bc.de",
"expected": {
"type": "string",
"value": "a@bc.de"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape interpolation start",
"expression": "@{ Hello there",
"expected": {
"type": "error",
"value": "Error tokenizing '@{ Hello there'."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"name": "string escape escaped interpolation start",
"expression": "\\@{ Hello there",
"expected": {
"type": "string",
"value": "@{ Hello there"
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "\\@{var} = @{var}",
"expected": {
"type": "string",
"value": "@{var} = value"
},
"variables": [
{
"name": "var",
"type": "string",
"value": "value"
}
],
"platforms": [
"android",
"ios",
"web"
]
}
]
}