Adapt tests to show that floats work properly.

This commit is contained in:
Christian Theune 2016-01-06 10:03:24 +01:00
parent b4bda4765a
commit 5cdcaf5e8e
7 changed files with 23 additions and 3 deletions

View File

@ -12,7 +12,9 @@ builtins.fromJSON
"Width": 100
},
"Animated" : false,
"IDs": [116, 943, 234, 38793, true ,false,null, -100]
"IDs": [116, 943, 234, 38793, true ,false,null, -100],
"Latitude": 37.7668,
"Longitude": -122.3959,
}
}
''
@ -28,5 +30,7 @@ builtins.fromJSON
};
Animated = false;
IDs = [ 116 943 234 38793 true false null (0-100) ];
Latitude = 37.7668;
Longitude = -122.3959;
};
}

View File

@ -1 +1 @@
"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3}"
"{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44}"

View File

@ -8,4 +8,5 @@ builtins.toJSON
g = [ 1 2 3 ];
h = [ "a" [ "b" { "foo\nbar" = {}; } ] ];
i = 1 + 2;
j = 1.44;
}

View File

@ -1 +1 @@
[ true false true false true false true false true false true false "int" "bool" "string" "null" "set" "list" "lambda" "lambda" "lambda" "lambda" ]
[ true false true false true false true false true true true true true true true true true true true false true false "int" "bool" "string" "null" "set" "list" "lambda" "lambda" "lambda" "lambda" ]

View File

@ -8,6 +8,16 @@ with builtins;
(isString [ "x" ])
(isInt (1 + 2))
(isInt { x = 123; })
(isInt (1 / 2))
(isInt (1 + 1))
(isInt (1 / 2))
(isInt (1 * 2))
(isInt (1 - 2))
(isFloat (1.2))
(isFloat (1 + 1.0))
(isFloat (1 / 2.0))
(isFloat (1 * 2.0))
(isFloat (1 - 2.0))
(isBool (true && false))
(isBool null)
(isAttrs { x = 123; })

View File

@ -45,5 +45,8 @@
<attr name="x">
<int value="123" />
</attr>
<attr name="y">
<float value="567.89" />
</attr>
</attrs>
</expr>

View File

@ -2,6 +2,8 @@ rec {
x = 123;
y = 567.890;
a = "foo";
b = "bar";