diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 19:14:43 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 19:14:43 +0000 |
commit | bcf60bb09a7aaf6a311e0928f9d870ab92c32c80 (patch) | |
tree | 2a4fa8e62c50f85a6e040bcdb0c50c9c35d30e46 /base/json_writer_unittest.cc | |
parent | 905d993a879a87175837fcb01451f6450ecf325f (diff) | |
download | chromium_src-bcf60bb09a7aaf6a311e0928f9d870ab92c32c80.zip chromium_src-bcf60bb09a7aaf6a311e0928f9d870ab92c32c80.tar.gz chromium_src-bcf60bb09a7aaf6a311e0928f9d870ab92c32c80.tar.bz2 |
Landing this patch for Jamesr.
CR was done at: http://codereview.chromium.org/67257
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json_writer_unittest.cc')
-rw-r--r-- | base/json_writer_unittest.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/json_writer_unittest.cc b/base/json_writer_unittest.cc index 4b6f312..9f24fe1 100644 --- a/base/json_writer_unittest.cc +++ b/base/json_writer_unittest.cc @@ -32,6 +32,18 @@ TEST(JSONWriterTest, Writing) { ASSERT_EQ("1.0", output_js); delete root; + // Test Real values in the the range (-1, 1) must have leading zeros + root = Value::CreateRealValue(0.2); + JSONWriter::Write(root, false, &output_js); + ASSERT_EQ("0.2", output_js); + delete root; + + // Test Real values in the the range (-1, 1) must have leading zeros + root = Value::CreateRealValue(-0.8); + JSONWriter::Write(root, false, &output_js); + ASSERT_EQ("-0.8", output_js); + delete root; + // Writer unittests like empty list/dict nesting, // list list nesting, etc. DictionaryValue root_dict; |