Use exactly representable floating point numbers in tests

CDRIVER-1945 increased the precision when rendering floating point numbers in JavaScript. Using numbers that can be exactly represented in floating point will allow us to keep the expected output consistent with our input.
This commit is contained in:
Jeremy Mikola
2017-01-13 14:30:36 -05:00
parent 31b8693bba
commit 1cfffa5589
2 changed files with 5 additions and 6 deletions

View File

@@ -10,8 +10,7 @@ $tests = array(
array((object)array("hello" => "world")),
array(null),
array(123),
array(4.23),
array(4.125),
array(true),
array(false),
array("string"),
@@ -60,7 +59,7 @@ Test#2 { "0" : null }
OK
Test#3 { "0" : 123 }
OK
Test#4 { "0" : 4.23 }
Test#4 { "0" : 4.125 }
OK
Test#5 { "0" : true }
OK

View File

@@ -15,7 +15,7 @@ $tests = array(
array(array("0" => 1, "1" => 2, "2" => 3, "3" => 4, "4" => 5, "5" => 6, "6" => 7, "7" => 8, "8" => 9)),
array(null),
array(123),
array(4.23),
array(4.125),
array(true),
array(false),
array("string"),
@@ -74,8 +74,8 @@ Test#7 { "0" : null }
0 : 08 00 00 00 0a 30 00 00 [.....0..]
Test#8 { "0" : 123 }
0 : 0c 00 00 00 10 30 00 7b 00 00 00 00 [.....0.{....]
Test#9 { "0" : 4.23 }
0 : 10 00 00 00 01 30 00 ec 51 b8 1e 85 eb 10 40 00 [.....0..Q.....@.]
Test#9 { "0" : 4.125 }
0 : 10 00 00 00 01 30 00 00 00 00 00 00 80 10 40 00 [.....0........@.]
Test#10 { "0" : true }
0 : 09 00 00 00 08 30 00 01 00 [.....0...]
Test#11 { "0" : false }