{ "cases": [ { "name": "positive integer to string => string", "expression": "@{toString(1)}", "expected": { "type": "string", "value": "1" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "negative integer to string => string", "expression": "@{toString(-1)}", "expected": { "type": "string", "value": "-1" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "positive number to string => string", "expression": "@{toString(3.1415)}", "expected": { "type": "string", "value": "3.1415" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "negative number to string => string", "expression": "@{toString(-3.1415)}", "expected": { "type": "string", "value": "-3.1415" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "exponential number => string", "expression": "@{toString(1e23)}", "expected": { "type": "string", "value": "1.0E23" }, "variables": [], "platforms": [ "web" ] }, { "name": "number variable => string", "expression": "@{toString(val)}", "expected": { "type": "string", "value": "123.0" }, "variables": [ { "type": "number", "name": "val", "value": 123 } ], "platforms": [ "web", "android", "ios" ] }, { "name": "true boolean to string => string", "expression": "@{toString(true)}", "expected": { "type": "string", "value": "true" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "false boolean to string => string", "expression": "@{toString(false)}", "expected": { "type": "string", "value": "false" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "color with format #RGB to string => string", "expression": "@{toString(color)}", "expected": { "type": "string", "value": "#FFFFCCEE" }, "variables": [ { "type": "color", "name": "color", "value": "#fce" } ], "platforms": [ "android", "ios", "web" ] }, { "name": "color with format #ARGB to string => string", "expression": "@{toString(color)}", "expected": { "type": "string", "value": "#DDFFCCEE" }, "variables": [ { "type": "color", "name": "color", "value": "#dfce" } ], "platforms": [ "android", "ios", "web" ] }, { "name": "color with format #RRGGBB to string => string", "expression": "@{toString(color)}", "expected": { "type": "string", "value": "#FFFFCCEE" }, "variables": [ { "type": "color", "name": "color", "value": "#ffCCeE" } ], "platforms": [ "android", "ios", "web" ] }, { "name": "color with format #AARRGGBB to string => string", "expression": "@{toString(color)}", "expected": { "type": "string", "value": "#DDFFCCEE" }, "variables": [ { "type": "color", "name": "color", "value": "#DdffCCeE" } ], "platforms": [ "android", "ios", "web" ] }, { "name": "url to string => string", "expression": "@{toString(url)}", "expected": { "type": "string", "value": "https://ya.ru/?hello=1" }, "variables": [ { "type": "url", "name": "url", "value": "https://ya.ru/?hello=1" } ], "platforms": [ "android", "ios", "web" ] }, { "name": "toString(array) => string", "expression": "@{toString(array)}", "expected": { "type": "string", "value": "[\"string\",[123,123.45,true]]" }, "variables": [ { "type": "array", "name": "array", "value": [ "string", [ 123, 123.45, true ] ] } ], "platforms": [ "ios", "web" ] }, { "name": "toString(dict) => string", "expression": "@{toString(dict)}", "expected": { "type": "string", "value": "{\"boolean\":true,\"dict\":{\"integer\":123,\"number\":123.45},\"string\":\"value\"}" }, "variables": [ { "type": "dict", "name": "dict", "value": { "boolean": true, "dict": { "integer": 123, "number": 123.45 }, "string": "value" } } ], "platforms": [ "ios", "web" ] }, { "name": "toString('abc') => 'abc'", "expression": "@{toString('abc')}", "expected": { "type": "string", "value": "abc" }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "empty argument list => error", "expression": "@{toString()}", "expected": { "type": "error", "value": "Failed to evaluate [toString()]. Function requires non empty argument list." }, "variables": [], "platforms": [ "android", "ios", "web" ] }, { "name": "too many arguments => error", "expression": "@{toString(1, 1)}", "expected": { "type": "error", "value": "Failed to evaluate [toString(1, 1)]. Function has no matching overload for given argument types: Integer, Integer." }, "variables": [], "platforms": [ "android", "ios", "web" ] } ] }