diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-18 17:13:30 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-18 17:13:30 -0700 |
commit | 1b2f6f9e29bf7137e177b8d9b600fe558d36f512 (patch) | |
tree | c67553632967b08349b9b5e83a897d189dafd8f2 /deps/v8/test/cctest/test-conversions.cc | |
parent | 5d400cfd3a2a9faf27a88bf82f33a57f78fa65af (diff) | |
download | node-new-1b2f6f9e29bf7137e177b8d9b600fe558d36f512.tar.gz |
Upgrade V8 to 2.5.0
Diffstat (limited to 'deps/v8/test/cctest/test-conversions.cc')
-rw-r--r-- | deps/v8/test/cctest/test-conversions.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/deps/v8/test/cctest/test-conversions.cc b/deps/v8/test/cctest/test-conversions.cc index abcd426ec4..c62bbaaabb 100644 --- a/deps/v8/test/cctest/test-conversions.cc +++ b/deps/v8/test/cctest/test-conversions.cc @@ -168,6 +168,38 @@ TEST(MaximumSignificantDigits) { CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS)); } +TEST(MinimumExponent) { + // Same test but with different point-position. + char num[] = + "445014771701440202508199667279499186358524265859260511351695091" + "228726223124931264069530541271189424317838013700808305231545782" + "515453032382772695923684574304409936197089118747150815050941806" + "048037511737832041185193533879641611520514874130831632725201246" + "060231058690536206311752656217652146466431814205051640436322226" + "680064743260560117135282915796422274554896821334728738317548403" + "413978098469341510556195293821919814730032341053661708792231510" + "873354131880491105553390278848567812190177545006298062245710295" + "816371174594568773301103242116891776567137054973871082078224775" + "842509670618916870627821633352993761380751142008862499795052791" + "018709663463944015644907297315659352441231715398102212132212018" + "470035807616260163568645811358486831521563686919762403704226016" + "998291015625000000000000000000000000000000000e-1108"; + + CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS)); + + // Changes the result of strtod (at least in glibc implementation). + num[sizeof(num) - 8] = '1'; + + CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS)); +} + + +TEST(MaximumExponent) { + char num[] = "0.16e309"; + + CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS)); +} + TEST(ExponentNumberStr) { CHECK_EQ(1e1, StringToDouble("1e1", NO_FLAGS)); |