Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: base/version_unittest.cc

Issue 949573002: Support plugin version mid-portions with leading zeros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/version_unittest.cc
diff --git a/base/version_unittest.cc b/base/version_unittest.cc
index 3119c3972a73b157a762c60c7c12328c0b8c5807..46d8255d15379d7a7553043e4bd1ab0972b6498b 100644
--- a/base/version_unittest.cc
+++ b/base/version_unittest.cc
@@ -41,16 +41,22 @@ TEST(VersionTest, GetVersionFromString) {
{".", 0, false},
{" . ", 0, false},
{"0", 1, true},
+ {"0.", 0, false},
{"0.0", 2, true},
{"65537.0", 0, false},
{"-1.0", 0, false},
{"1.-1.0", 0, false},
+ {"1,--1.0", 0, false},
{"+1.0", 0, false},
{"1.+1.0", 0, false},
+ {"1+1.0", 0, false},
+ {"++1.0", 0, false},
{"1.0a", 0, false},
{"1.2.3.4.5.6.7.8.9.0", 10, true},
{"02.1", 0, false},
+ {"0.01", 2, true},
{"f.1", 0, false},
+ {"15.007.20011", 3, true},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
@@ -77,6 +83,7 @@ TEST(VersionTest, Compare) {
{"1.1", "1.0.1", 1},
{"1.0.0", "1.0", 0},
{"1.0.3", "1.0.20", -1},
+ {"11.0.10", "15.007.20011", -1},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
Version lhs(cases[i].lhs);
« no previous file with comments | « base/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698