mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-31 13:22:16 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user