mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00:00
Adapt tests to show that floats work properly.
This commit is contained in:
parent
b4bda4765a
commit
5cdcaf5e8e
@ -12,7 +12,9 @@ builtins.fromJSON
|
|||||||
"Width": 100
|
"Width": 100
|
||||||
},
|
},
|
||||||
"Animated" : false,
|
"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;
|
Animated = false;
|
||||||
IDs = [ 116 943 234 38793 true false null (0-100) ];
|
IDs = [ 116 943 234 38793 true false null (0-100) ];
|
||||||
|
Latitude = 37.7668;
|
||||||
|
Longitude = -122.3959;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -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}"
|
||||||
|
@ -8,4 +8,5 @@ builtins.toJSON
|
|||||||
g = [ 1 2 3 ];
|
g = [ 1 2 3 ];
|
||||||
h = [ "a" [ "b" { "foo\nbar" = {}; } ] ];
|
h = [ "a" [ "b" { "foo\nbar" = {}; } ] ];
|
||||||
i = 1 + 2;
|
i = 1 + 2;
|
||||||
|
j = 1.44;
|
||||||
}
|
}
|
||||||
|
@ -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" ]
|
||||||
|
@ -8,6 +8,16 @@ with builtins;
|
|||||||
(isString [ "x" ])
|
(isString [ "x" ])
|
||||||
(isInt (1 + 2))
|
(isInt (1 + 2))
|
||||||
(isInt { x = 123; })
|
(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 (true && false))
|
||||||
(isBool null)
|
(isBool null)
|
||||||
(isAttrs { x = 123; })
|
(isAttrs { x = 123; })
|
||||||
|
@ -45,5 +45,8 @@
|
|||||||
<attr name="x">
|
<attr name="x">
|
||||||
<int value="123" />
|
<int value="123" />
|
||||||
</attr>
|
</attr>
|
||||||
|
<attr name="y">
|
||||||
|
<float value="567.89" />
|
||||||
|
</attr>
|
||||||
</attrs>
|
</attrs>
|
||||||
</expr>
|
</expr>
|
||||||
|
@ -2,6 +2,8 @@ rec {
|
|||||||
|
|
||||||
x = 123;
|
x = 123;
|
||||||
|
|
||||||
|
y = 567.890;
|
||||||
|
|
||||||
a = "foo";
|
a = "foo";
|
||||||
|
|
||||||
b = "bar";
|
b = "bar";
|
||||||
|
Loading…
Reference in New Issue
Block a user