Files
pkurchatov 954cd7a3a4 Expressions test data cleanup
c82be23dcc68e726e2f95558b2b8f246a139061b
2024-06-11 11:51:05 +03:00

221 lines
4.5 KiB
JSON

{
"cases": [
{
"expression": "@{toInteger(2.7182)}",
"expected": {
"type": "integer",
"value": 2
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(3.1415)}",
"expected": {
"type": "integer",
"value": 3
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(-2.7182)}",
"expected": {
"type": "integer",
"value": -2
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(-3.1415)}",
"expected": {
"type": "integer",
"value": -3
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(3.1415e64)}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger(3.1415E64)]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(-3.1415e64)}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger(-3.1415E64)]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('1')}",
"expected": {
"type": "integer",
"value": 1
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('+1')}",
"expected": {
"type": "integer",
"value": 1
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('-1')}",
"expected": {
"type": "integer",
"value": -1
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('3.1415')}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger('3.1415')]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('3141592653589793238462643')}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger('3141592653589793238462643')]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('-3141592653589793238462643')}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger('-3141592653589793238462643')]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('1+1')}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger('1+1')]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger('hello')}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger('hello')]. Unable to convert value to Integer."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(true)}",
"expected": {
"type": "integer",
"value": 1
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(false)}",
"expected": {
"type": "integer",
"value": 0
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger()}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger()]. Function requires non empty argument list."
},
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{toInteger(1.0, 1.0)}",
"expected": {
"type": "error",
"value": "Failed to evaluate [toInteger(1.0, 1.0)]. Function has no matching overload for given argument types: Number, Number."
},
"platforms": [
"android",
"ios",
"web"
]
}
]
}