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

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: 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..e28bb660559296e4f59515eff0fae6b52c766d6b 100644
--- a/base/version_unittest.cc
+++ b/base/version_unittest.cc
@@ -47,10 +47,12 @@ TEST(VersionTest, GetVersionFromString) {
{"1.-1.0", 0, false},
{"+1.0", 0, false},
{"1.+1.0", 0, false},
+ {"1+1.0", 0, false},
{"1.0a", 0, false},
{"1.2.3.4.5.6.7.8.9.0", 10, true},
- {"02.1", 0, false},
+ {"02.1", 2, true},
Nico 2015/02/21 23:11:16 Should we still disallow 0s on the first version c
Will Harris 2015/02/22 00:37:37 yes I agree that makes most sense. Done.
{"f.1", 0, false},
+ {"15.007.20011", 3, true},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
@@ -77,6 +79,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