Commit 736f5348 authored by Nigel Tao's avatar Nigel Tao Committed by Commit Bot

Add more StringToDouble test cases

Some callers (in bigger, more complicated code and tests) rely on
StringToDouble's "return non-zero with failure" best-effort behavior
when the number has a unit suffix.

Change-Id: I7ac38fec189e8193895547664ddc09c071e1bdc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310370
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791381}
parent 1bcc6dc1
...@@ -841,6 +841,8 @@ TEST(StringNumberConversionsTest, StringToDouble) { ...@@ -841,6 +841,8 @@ TEST(StringNumberConversionsTest, StringToDouble) {
{"+123 e4", 123.0, false}, {"+123 e4", 123.0, false},
{"123e ", 123.0, false}, {"123e ", 123.0, false},
{"123e", 123.0, false}, {"123e", 123.0, false},
{"10.5px", 10.5, false},
{"11.5e2em", 1150, false},
{" 2.99", 2.99, false}, {" 2.99", 2.99, false},
{"1e3.4", 1000.0, false}, {"1e3.4", 1000.0, false},
{"nothing", 0.0, false}, {"nothing", 0.0, false},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment