summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userstring.py
Commit message (Collapse)AuthorAgeFilesLines
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-0/+23
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* Add support for negative indices in UserString.MutableString.__setitem__Walter Dörwald2005-02-181-7/+7
| | | | and UserString.MutableString.__delitem__.
* Fix copy & paste error.Walter Dörwald2005-02-171-2/+2
|
* Add tests for the methods added by UserString.MutableString.Walter Dörwald2005-02-171-0/+62
|
* Add a basic test for UserString.MutableString.Walter Dörwald2005-02-171-2/+9
|
* SF #989185: Drop unicode.iswide() and unicode.width() and addHye-Shik Chang2004-08-041-2/+1
| | | | | | | | | | | | unicodedata.east_asian_width(). You can still implement your own simple width() function using it like this: def width(u): w = 0 for c in unicodedata.normalize('NFC', u): cwidth = unicodedata.east_asian_width(c) if cwidth in ('W', 'F'): w += 2 else: w += 1 return w
* Add iswide() and width() method for UserString according as theHye-Shik Chang2004-06-041-1/+2
| | | | addition to unicode objects.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-3/+1
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Port all string tests to PyUnit and share as much testsWalter Dörwald2003-02-211-39/+46
| | | | | | | between str, unicode, UserString and the string module as possible. This increases code coverage in stringobject.c from 83% to 86% and should help keep the string classes in sync in the future. From SF patch #662807
* Moved inplace add and multiply methods from UserString to MutableString.Raymond Hettinger2002-08-091-0/+1
| | | | | Closes SF Bug #592573 where inplace add mutated a UserString. Added unittests to verify the bug is cleared.
* Committing patch #591250 which provides "str1 in str2" when str1 is aBarry Warsaw2002-08-061-0/+1
| | | | string of longer than 1 character.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-2/+2
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* I am mad. This test never worked!Guido van Rossum2002-04-121-16/+14
| | | | | | | | | | | | | | | | | | | | | | The test function's signature should be test(methodname, input, output, *args) but the output argument was omitted. This caused all tests to fail, because the expected output was passed as the initial argument to the method call. But because of the way the test works (it compares the results for a regular string to the results for a UserString instance with the same value, and it's OK if both raise the same exception) the test never failed! I've fixed this, and also cleaned up a few warts in the verbose output. Finally, I've made it possible to run the test stand-alone in verbose mode by passing -v as a command line argument. Now, the test will report failure related to zfill. That's not my fault, that's a legitimate problem: the string_tests.py file contains a test for the zfill() method (just added) but this method is not implemented. The responsible party will surely fix this soon now.
* String method conversion.Eric S. Raymond2001-02-091-1/+1
| | | | (This one was trivial -- no actual string. references in it!)
* a bold attempt to fix things broken by MAL's verify patch: importFredrik Lundh2001-01-171-1/+1
| | | | 'verify' iff it's used by a test module...
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-1/+1
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* factor out test definitions to string_tests moduleJeremy Hylton2000-07-101-184/+2
| | | | test_string and test_userstring run same tests for string methods
* UserString class from Peter Funk <pf@artcom-gmbh.de>.Fred Drake2000-04-031-0/+227