summaryrefslogtreecommitdiffstats
path: root/base/string_split_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make SplitString() and variants clear their outparam vector. (Note that ↵pkasting@chromium.org2012-06-261-3/+0
| | | | | | | | | | | | | SplitStringIntoKeyValues() and SplitStringIntoKeyValuePairs() already did this.) This is more in line with what other APIs that take outparams do. I audited all callers, and the only ones affected by this are the buggy ones in bug 134695 that already wanted this behavior, as well as the couple of places in this CL that were manually calling clear() and now don't have to. BUG=134695 TEST=none TBR=brettw,phajdan.jr Review URL: https://chromiumcodereview.appspot.com/10684003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144323 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r129998: When input is "" (or " " with trim_whitespace true), ↵pkasting@chromium.org2012-04-031-9/+12
| | | | | | | | | | | | | | | | SplitString() should return an empty vector, not a vector of one empty string. Brett and I discussed this for a while and felt this would be wise, whereas dropping all empty segments entirely (e.g. converting "a,,b" to a vector of two elements instead of three) was probably unwise. This also simplifies the code some. Fixing this also required changing the code in mime_util.cc to handle empty vectors to "are codecs valid" oracle functions (in which case we return false). I also fixed some style issues there. It also required avoiding passing the empty string in a test in extension_api_unittest.cc; Aaron assures me that this code is not expected to be defensive against such inputs, but at his suggestion I also added some CHECK()s to the API. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9958076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130285 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r12998 - it broke some media/mime-related layout tests.dpranke@chromium.org2012-03-311-12/+9
| | | | | | | | TBR=pkasting@chromium.org, scherkus@chromium.org Review URL: https://chromiumcodereview.appspot.com/9950039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130011 0039d316-1c4b-4281-b951-d872f2087c98
* When input is "" (or " " with trim_whitespace true), SplitString() should ↵pkasting@chromium.org2012-03-301-9/+12
| | | | | | | | | | | | | | | | return an empty vector, not a vector of one empty string. Brett and I discussed this for a while and felt this would be wise, whereas dropping all empty segments entirely (e.g. converting "a,,b" to a vector of two elements instead of three) was probably unwise. This also simplifies the code some. Fixing this also required changing the code in mime_util.cc to handle empty vectors to "are codecs valid" oracle functions (in which case we return false). I also fixed some style issues there. It also required avoiding passing the empty string in a test in extension_api_unittest.cc; Aaron assures me that this code is not expected to be defensive against such inputs, but at his suggestion I also added some CHECK()s to the API. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9960004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129998 0039d316-1c4b-4281-b951-d872f2087c98
* wstring: remove SplitStringAlongWhitespace for wcharevan@chromium.org2011-09-231-17/+17
| | | | | | | | | | There was only one user, which did a bunch of nonsense. BUG=23581 Review URL: http://codereview.chromium.org/8008003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102563 0039d316-1c4b-4281-b951-d872f2087c98
* wstring: remove wstring version of SplitStringevan@chromium.org2011-05-051-1/+20
| | | | | | | | | | Retry of r84336. BUG=23581 Review URL: http://codereview.chromium.org/6930047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84355 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "wstring: remove wstring version of SplitString"evan@chromium.org2011-05-051-20/+1
| | | | | | This reverts commit r84336. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84339 0039d316-1c4b-4281-b951-d872f2087c98
* wstring: remove wstring version of SplitStringevan@chromium.org2011-05-051-1/+20
| | | | | | | | BUG=23581 Review URL: http://codereview.chromium.org/6930047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84336 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move StringSplitAlongWhitespace to string_split.htfarina@chromium.org2010-11-151-0/+32
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/5004002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66181 0039d316-1c4b-4281-b951-d872f2087c98
* base: remove various unused string utility functionsevan@chromium.org2010-10-141-9/+9
| | | | | | | | TEST=trybots Review URL: http://codereview.chromium.org/3753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62580 0039d316-1c4b-4281-b951-d872f2087c98
* base: Finish moving the SplitString functions from string_util.h to ↵tfarina@chromium.org2010-09-241-0/+67
| | | | | | | | | | | string_split.h BUG=None TEST=trybos Review URL: http://codereview.chromium.org/3447008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60422 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move SplitStringDontTrim functions from string_util.h to string_split.htfarina@chromium.org2010-09-151-0/+18
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3366011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59493 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move SplitStringUsingSubstr functions from string_util.h to string_split.htfarina@chromium.org2010-09-021-0/+48
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3284005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58300 0039d316-1c4b-4281-b951-d872f2087c98
* TTF: Re-enable SplitStringIntoKeyValuePairsTest.EmptyString. Fix the casejhawkins@chromium.org2010-05-051-1/+13
| | | | | | | | | | | | where an empty pair would cause SplitStringIntoKeyValuePairs to report an error yet add the empty pair to the pairs list. Add more tests. BUG=none TEST=SplitStringIntoKeyValuePairsTest.*, StringUtilTest.SplitString Review URL: http://codereview.chromium.org/1971001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46420 0039d316-1c4b-4281-b951-d872f2087c98
* Move two generic string split functions from sync API to their own API in ↵timsteele@google.com2010-01-211-0/+120
base/string_split. BUG=None TEST=base_unittests Original patch by Thiago Farina Original Review: http://codereview.chromium.org/464075 Review URL: http://codereview.chromium.org/502074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36774 0039d316-1c4b-4281-b951-d872f2087c98