summaryrefslogtreecommitdiffstats
path: root/Lib/test/string_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove relics of str8 (became bytes) and buffer (bytearray) type testsMartin Panter2016-04-101-33/+0
| | | | Remove redundant tests now that str is unicode.
* Issue #26712: Unify (r)split, (l/r)strip tests into string_testsMartin Panter2016-04-101-5/+31
| | | | This eliminates a few redundant test cases.
* Issue #26257: Eliminate buffer_tests.py and fix ByteArrayAsStringTestMartin Panter2016-04-061-36/+40
| | | | | | | | | | | | | | | | ByteArrayAsStringTest.fixtype() was converting test data to bytes, not byte- array, therefore many of the test cases inherited in this class were not actually being run on the bytearray type. The tests in buffer_tests.py were redundant with methods in string_tests .MixinStrUnicodeUserStringTest and string_tests.CommonTest. These methods are now moved into string_tests.BaseTest, where they will also get run for bytes and bytearray. This change also moves test_additional_split(), test_additional_rsplit(), and test_strip() from CommonTest to BaseTest, meaning these tests are now run for bytes and bytearray. I plan to eliminate redundancies with existing tests in test_bytes.py soon.
* Issue #19587: Remove masked and redundant tests in test_bytesMartin Panter2016-02-021-6/+4
| | | | | | | | * test_contains() did not override anything * test_expandtabs/upper/lower() in FixedStringTest were masking usable tests in string_tests. These tests now get run for bytearray() and bytes(). * test_expandtabs/upper/lower() in buffer_tests were only run on bytearray() and are redundant with string_tests
* Fix a couple of typos in code commentsMartin Panter2015-12-171-1/+1
|
* Issue #24284: The startswith and endswith methods of the str class no longerSerhiy Storchaka2015-05-311-0/+6
| | | | | return True when finding the empty string and the indexes are completely out of range.
* merge 3.4 (#22379)Benjamin Peterson2014-09-281-8/+6
|\
| * check that exception messages are not empty (#22379)Benjamin Peterson2014-09-281-8/+6
| | | | | | | | Patch by Yongzhi Pan.
* | Issue19995: passing a non-int to %o, %c, %x, or %X now raises an exceptionEthan Furman2014-03-191-2/+1
|/
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-8/+15
|\
| * Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-8/+15
| |
* | Catch deprecation warnings emitted when non-integers are formatted with %c, %oSerhiy Storchaka2014-02-061-1/+2
| | | | | | | | and %x (introduced in issue #19995).
* | Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-2/+2
|\ \ | |/
| * Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-2/+2
| |
* | #17806: Added keyword-argument support for "tabsize" to str/bytes.expandtabs().Ezio Melotti2013-11-161-7/+20
|/
* Remove duplicated tests.Ezio Melotti2013-04-211-21/+0
|
* Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-0/+11
|\ | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
| * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-0/+11
| | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* | #16910: test_bytes, test_unicode, and test_userstring now work with unittest ↵Ezio Melotti2013-01-101-1/+1
| | | | | | | | test discovery. Patch by Zachary Ware.
* | merge 3.2 (#15801)Benjamin Peterson2012-08-281-0/+3
|\ \ | |/
| * use the stricter PyMapping_Check (closes #15801)Benjamin Peterson2012-08-281-0/+3
| |
* | Close #15534: Fix a typo in the fast search function of the string library ↵Victor Stinner2012-08-021-0/+8
| | | | | | | | | | | | (_s => s) Replace _s with ptr to avoid future confusion. Add also non regression tests.
* | Issue #14700: Fix two broken and undefined-behaviour-inducing overflow ↵Mark Dickinson2012-05-071-0/+4
| | | | | | | | checks in old-style string formatting. Thanks Serhiy Storchaka for report and original patch.
* | #14081: The sep and maxsplit parameter to str.split, bytes.split, and ↵Ezio Melotti2012-02-261-1/+23
| | | | | | | | bytearray.split may now be passed as keyword arguments.
* | use full unicode mappings for upper/lower/title case (#12736)Benjamin Peterson2012-01-111-1/+1
| | | | | | | | Also broaden the category of characters that count as lowercase/uppercase.
* | Issue #12170: The count(), find(), rfind(), index() and rindex() methodsAntoine Pitrou2011-10-201-5/+30
| | | | | | | | | | of bytes and bytearray objects now accept an integer between 0 and 255 as their first argument. Patch by Petri Lehtinen.
* | Issue #13012: Allow 'keepends' to be passed as a keyword argument in ↵Mark Dickinson2011-09-241-3/+11
|/ | | | str.splitlines, bytes.splitlines and bytearray.splitlines.
* #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and ↵Ezio Melotti2011-08-151-0/+17
| | | | cased non-letter characters.
* Use non-deprecated method name.Ezio Melotti2011-04-201-7/+7
|
* MERGE: startswith and endswith don't accept None as slice index. Patch by ↵Jesus Cea2011-04-201-0/+57
|\ | | | | | | Torsten Becker. (closes #11828)
| * startswith and endswith don't accept None as slice index. Patch by Torsten ↵Jesus Cea2011-04-201-0/+57
| | | | | | | | Becker. (closes #11828)
| * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-11/+11
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
| * Merged revisions 77731 via svnmerge fromEzio Melotti2010-01-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77731 | ezio.melotti | 2010-01-24 22:59:24 +0200 (Sun, 24 Jan 2010) | 9 lines Merged revisions 77729 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77729 | ezio.melotti | 2010-01-24 22:48:35 +0200 (Sun, 24 Jan 2010) | 1 line remove archaic functions from test_support ........ ................
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-11/+11
| |
* | Reenable test_ucs4 and remove some duplicated lines.Florent Xicluna2010-09-131-1/+1
| |
* | Merged revisions 77729 via svnmerge fromEzio Melotti2010-01-241-9/+9
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77729 | ezio.melotti | 2010-01-24 22:48:35 +0200 (Sun, 24 Jan 2010) | 1 line remove archaic functions from test_support ........
* | Merged revisions 77249 via svnmerge fromAntoine Pitrou2010-01-021-4/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77249 | antoine.pitrou | 2010-01-02 22:53:44 +0100 (sam., 02 janv. 2010) | 3 lines Remove silly conditional. ........
* | Merged revisions 77247 via svnmerge fromAntoine Pitrou2010-01-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77247 | antoine.pitrou | 2010-01-02 22:47:10 +0100 (sam., 02 janv. 2010) | 5 lines Add tests for issue #7458: str.rfind() would crash when called with an invalid start value. The offending code itself was removed as part of #7462. This patch by Victor Stinner. ........
* | Merged revisions 77241 via svnmerge fromAntoine Pitrou2010-01-021-0/+24
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77241 | antoine.pitrou | 2010-01-02 22:12:58 +0100 (sam., 02 janv. 2010) | 4 lines Issue #7462: Implement the stringlib fast search algorithm for the `rfind`, `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna. ........
* | Issue #7435: Remove duplicate int/long tests, and otherMark Dickinson2009-12-051-2/+1
|/ | | | references to long in py3k. Patch provided by flox.
* Issue #5859: Remove use of fixed-length buffers for float formattingMark Dickinson2009-05-011-8/+1
| | | | | | in unicodeobject.c and the fallback version of PyOS_double_to_string. As a result, operations like '%.120e' % 12.34 no longer raise an exception.
* Merged revisions 66631 via svnmerge fromAmaury Forgeot d'Arc2008-09-261-0/+16
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66631 | amaury.forgeotdarc | 2008-09-27 00:34:08 +0200 (sam., 27 sept. 2008) | 7 lines #3967: Correct a crash in count() and find() methods of string-like objects. For example: "".count("xxxx", sys.maxint, 0) Reviewed by Benjamin Peterson. Will port to 2.5 and 3.0. ........
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-1/+1
|
* Merged revisions 61034-61036,61038-61048 via svnmerge fromChristian Heimes2008-02-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r61034 | georg.brandl | 2008-02-24 01:03:22 +0100 (Sun, 24 Feb 2008) | 4 lines #900744: If an invalid chunked-encoding header is sent by a server, httplib will now raise IncompleteRead and close the connection instead of raising ValueError. ........ r61035 | georg.brandl | 2008-02-24 01:14:24 +0100 (Sun, 24 Feb 2008) | 2 lines #1627: httplib now ignores negative Content-Length headers. ........ r61039 | andrew.kuchling | 2008-02-24 03:39:15 +0100 (Sun, 24 Feb 2008) | 1 line Remove stray word ........ r61040 | neal.norwitz | 2008-02-24 03:40:58 +0100 (Sun, 24 Feb 2008) | 3 lines Add a little info to the 3k deprecation warnings about what to use instead. Suggested by Raymond Hettinger. ........ r61041 | facundo.batista | 2008-02-24 04:17:21 +0100 (Sun, 24 Feb 2008) | 4 lines Issue 1742669. Now %d accepts very big float numbers. Thanks Gabriel Genellina. ........ r61046 | neal.norwitz | 2008-02-24 08:21:56 +0100 (Sun, 24 Feb 2008) | 5 lines Get ctypes working on the Alpha (Tru64). The problem was that there were two module_methods and the one used depended on the order the modules were loaded. By making the test module_methods static, it is not exported and the correct version is picked up. ........ r61048 | neal.norwitz | 2008-02-24 09:27:49 +0100 (Sun, 24 Feb 2008) | 1 line Fix typo of hexidecimal ........
* Move UserList to collections.Raymond Hettinger2008-02-121-1/+1
|
* Removed PyInt_GetMax and sys.maxintChristian Heimes2007-12-041-18/+18
| | | | | I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform. Also added docs for sys.maxsize.
* Removed some leftovers from the str8 daysChristian Heimes2007-11-221-4/+0
|
* Rename buffer -> bytearray.Guido van Rossum2007-11-211-2/+2
|
* Merged revisions 59005-59040 via svnmerge fromChristian Heimes2007-11-181-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk I've tried to fix test_cmd_line_script but I wasn't able to get all tests right. Nick, can you please have a look? ........ r59020 | facundo.batista | 2007-11-16 19:04:14 +0100 (Fri, 16 Nov 2007) | 12 lines Now in find, rfind, index, and rindex, you can use None as defaults, as usual with slicing (both with str and unicode strings). This fixes issue 1259. For str only the stringobject.c file was modified. But for unicode, I needed to repeat in the four functions a lot of code, so created a new function that does part of the job for them (and placed it in find.h, following a suggestion of Barry). Also added tests for this behaviour. ........ r59021 | facundo.batista | 2007-11-16 19:41:24 +0100 (Fri, 16 Nov 2007) | 4 lines Fix for stupid error (I need to remember to do a full 'make clean + make' cycle before the tests...). Sorry. ........ r59022 | facundo.batista | 2007-11-16 20:16:15 +0100 (Fri, 16 Nov 2007) | 3 lines Made _ParseTupleFinds only defined to unicodeobject.c ........ r59024 | raymond.hettinger | 2007-11-17 02:51:22 +0100 (Sat, 17 Nov 2007) | 1 line Fix signature in example ........ r59033 | brett.cannon | 2007-11-17 08:07:29 +0100 (Sat, 17 Nov 2007) | 5 lines Remove a confusing sentence about pth files and which directories are searched for them. Closes issue #1431. Thanks Giambattista Bloisi for the help. ........ r59039 | nick.coghlan | 2007-11-18 12:56:28 +0100 (Sun, 18 Nov 2007) | 1 line Patch #1739468: Directories and zipfiles containing __main__.py are now executable ........
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-15/+15
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.