summaryrefslogtreecommitdiff
path: root/Lib/test/string_tests.py
AgeCommit message (Collapse)AuthorLines
2002-04-22Backport checkin:Walter Dörwald-1/+7
Apply patch diff.txt from SF feature request http://www.python.org/sf/444708 This adds the optional argument for str.strip to unicode.strip too and makes it possible to call str.strip with a unicode argument and unicode.strip with a str argument.
2002-04-22Backport the following changes:Walter Dörwald-0/+13
Misc/NEWS 1.387->1.388 Lib/test/string_tests.py 1.10->1.11, 1.12->1.14, Lib/test/test_unicode.py 1.50->1.51, 1.53->1.54, 1.55->1.56 Lib/test/test_string.py 1.15->1.16 Lib/string.py 1.61->1.63 Lib/test/test_userstring.py 1.5->1.6, 1.11, 1.12 Objects/stringobject.c 2.156->2.159 Objects/unicodeobject.c 2.137->2.139 Doc/lib/libstdtypes.tec 1.87->1.88 Add a method zfill to str, unicode and UserString and change Lib/string.py accordingly (see SF patch http://www.python.org/sf/536241) This also adds Guido's fix to test_userstring.py and the subinstance checks in test_string.py and test_unicode.py.
2002-04-18backport gvanrossum's patch:Anthony Baxter-0/+12
Partially implement SF feature request 444708. Add optional arg to string methods strip(), lstrip(), rstrip(). The optional arg specifies characters to delete. Also for UserString. Still to do: - Misc/NEWS - LaTeX docs (I did the docstrings though) - Unicode methods, and Unicode support in the string methods. Original patches were: python/dist/src/Lib/test/string_tests.py:1.12
2001-08-17Patch #445762: Support --disable-unicodeMartin v. Löwis-6/+7
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
2001-05-15This patch changes the way the string .encode() method works slightlyMarc-André Lemburg-0/+19
and introduces a new method .decode(). The major change is that strg.encode() will no longer try to convert Unicode returns from the codec into a string, but instead pass along the Unicode object as-is. The same is now true for all other codec return types. The underlying C APIs were changed accordingly. Note that even though this does have the potential of breaking existing code, the chances are low since conversion from Unicode previously took place using the default encoding which is normally set to ASCII rendering this auto-conversion mechanism useless for most Unicode encodings. The good news is that you can now use .encode() and .decode() with much greater ease and that the door was opened for better accessibility of the builtin codecs. As demonstration of the new feature, the patch includes a few new codecs which allow string to string encoding and decoding (rot13, hex, zip, uu, base64). Written by Marc-Andre Lemburg. Copyright assigned to the PSF.
2001-05-09SF bug #422088: [OSF1 alpha] string.replace().Tim Peters-0/+6
Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
2001-02-09String method conversion.Eric S. Raymond-2/+2
2001-01-29Fixed .capitalize() method of Unicode objects to work like theMarc-André Lemburg-0/+2
corresponding string method. Added tests for this too. Patch written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-18Whitespace normalization. Leaving tokenize_tests.py alone for now.Tim Peters-1/+1
2001-01-16Added checks to prevent PyUnicode_Count() from dumping coreMarc-André Lemburg-0/+4
in case the parameters are out of bounds and fixes error handling for .count(), .startswith() and .endswith() for the case of mixed string/Unicode objects. This patch adds Python style index semantics to PyUnicode_Count() indices (including the special handling of negative indices). The patch is an extended version of patch #103249 submitted by Michael Hudson (mwh) on SF. It also includes new test cases.
2000-07-11small updates to string_join:Jeremy Hylton-0/+3
use PyString_AS_STRING macro on local string object when resizing string, make sure resized string will always be big enough split string containing error message across two lines add test to string_tests that causes resizing
2000-07-11add more tests of string.join variants to run_method_testsJeremy Hylton-8/+11
2000-07-10factor out test definitions to string_tests moduleJeremy Hylton-0/+196
test_string and test_userstring run same tests for string methods