mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
Supported expressions in variable value field
commit_hash:a341b70bacca741f0cb6ea2f600cc4794c8b36a4
This commit is contained in:
@@ -180,6 +180,142 @@
|
||||
"flutter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{integer_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "integer",
|
||||
"value": 123
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "integer_var_with_expression",
|
||||
"type": "integer",
|
||||
"value": "@{123}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{number_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "number",
|
||||
"value": 123.0
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "number_var_with_expression",
|
||||
"type": "number",
|
||||
"value": "@{123.0}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{string_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "string",
|
||||
"value": "test string"
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "string_var_with_expression",
|
||||
"type": "string",
|
||||
"value": "@{'test string'}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{boolean_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "boolean_var_with_expression",
|
||||
"type": "boolean",
|
||||
"value": "@{true && false}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{color_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "color",
|
||||
"value": "#FF0000"
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "color_var_with_expression",
|
||||
"type": "color",
|
||||
"value": "@{'#FF0000'}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{url_var_with_expression}",
|
||||
"expected": {
|
||||
"type": "url",
|
||||
"value": "https://ya.ru"
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "url_var_with_expression",
|
||||
"type": "url",
|
||||
"value": "@{'https://ya.ru'}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{var_from_func}",
|
||||
"expected": {
|
||||
"type": "integer",
|
||||
"value": 5
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "var_from_func",
|
||||
"type": "integer",
|
||||
"value": "@{len('Hello')}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{circular_ref}",
|
||||
"expected": {
|
||||
"type": "error",
|
||||
"value": "Variable 'circular_ref' is missing."
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"name": "circular_ref",
|
||||
"type": "integer",
|
||||
"value": "@{circular_ref}"
|
||||
}
|
||||
],
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
},
|
||||
{
|
||||
"expression": "@{undeclred_var}",
|
||||
"expected": {
|
||||
|
||||
Reference in New Issue
Block a user