summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Moved inplace add and multiply methods from UserString to MutableString.Raymond Hettinger2002-08-093-0/+8
| | | | | Closes SF Bug #592573 where inplace add mutated a UserString. Added unittests to verify the bug is cleared.
* Revised the test suite for 'contains' to use the test() function argumentRaymond Hettinger2002-08-091-9/+9
| | | | | rather than vereq(). While it was effectively testing regular strings, it ignored the test() function argument when called by test_userstring.py.
* testSendAll(): loop until all data is read; this was necessary atGuido van Rossum2002-08-081-3/+3
| | | | | | least on OS/2 (see note on SF patch 555085 by A I MacIntyre) but looks like the test *could* fail on any other platform too -- there's no guarantee that recv() reads all data.
* Whitespace normalization.Tim Peters2002-08-086-16/+12
|
* Replace docstrings on test functions witrh comments -- then unittestGuido van Rossum2002-08-081-31/+50
| | | | | | | | | | | | | prints function and module names, which is more informative now that we repeat some tests in slightly modified subclasses. Add a test for read() until EOF. Add test suites for line-buffered (bufsize==1) and a small custom buffer size (bufsize==2). Restructure testUnbufferedRead() somewhat to avoid a potentially infinite loop.
* Tighten the unbuffered readline test to distinguish between the two lines.Guido van Rossum2002-08-071-4/+4
|
* Oops. I accidentally commented out some tests.Guido van Rossum2002-08-071-4/+4
|
* "Unbuffered" mode of class _fileobject wasn't actually unbuffered,Guido van Rossum2002-08-071-6/+35
| | | | | | | | | | and this broke a Zope "pipelining" test which read multiple responses from the same connection (this attaches a new file object to the socket for each response). Added a test for this too. (I want to do some code cleanup too, but I thought I'd first fix the problem with as little code as possible, and add a unit test for this case. So that's what this checkin is about.)
* Expanded the unittests for the new width sensitive PyUnicode_Contains().Raymond Hettinger2002-08-061-0/+6
|
* Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).Guido van Rossum2002-08-061-0/+14
| | | | Fix forthcoming.
* Added a test for PyUnicode_Contains() taking into account the width ofBarry Warsaw2002-08-061-0/+1
| | | | Py_UNICODE.
* Bump the LOOPS count. 50,000 iterations takes about 5 seconds on myGuido van Rossum2002-08-061-1/+1
| | | | machine -- that feels just right.
* Mark xreadlines deprecated. Don't use f.xreadlines() in test_iter.py.Guido van Rossum2002-08-062-2/+5
|
* Committing patch #591250 which provides "str1 in str2" when str1 is aBarry Warsaw2002-08-065-65/+88
| | | | string of longer than 1 character.
* Add next and __iter__ to the list of file methods that should raiseGuido van Rossum2002-08-061-1/+3
| | | | ValueError when called for a closed file.
* We only need to check for StopIteration here.Fred Drake2002-08-051-1/+1
|
* Test whether a Cyrillic text correctly appears in a Unicode literal.Martin v. Löwis2002-08-051-0/+2
|
* We don't really need the name of the test in the "test skipped" msg, andTim Peters2002-08-041-1/+1
| | | | having it there causes the line to wrap.
* Oops! Forgot the closing paren.Tim Peters2002-08-041-1/+1
|
* Finally got around to figuring out and documenting why this test failsTim Peters2002-08-041-2/+10
| | | | | | | | on Windows. The test_sequence() ERROR is easily repaired if we're willing to add an os.unlink() line to mhlib's updateline(). The test_listfolders FAIL I gave up on -- I don't remember enough about Unix link esoterica to recall why a link count of 2 is something a well- written program should be keenly interested in <wink>.
* Add encoding declaration.Martin v. Löwis2002-08-042-1/+2
|
* I don't know what's going on with this test, but the last change fromTim Peters2002-08-041-1/+1
| | | | | Piers obviously couldn't have passed on any platform. Fiddling it so it works (for a meaning of "works" no stronger than "doesn't fail" <wink>).
* revert to version 1.2Piers Lauder2002-08-031-5/+6
|
* Added new heapreplace(heap, item) function, to pop (and return) theTim Peters2002-08-031-3/+2
| | | | | currently-smallest value, and add item, in one gulp. See the second N-Best algorithm in the test suite for a natural use.
* Remove cut 'n paste silliness.Tim Peters2002-08-031-2/+0
|
* Minor fiddling, including a simple class to implement a heap iteratorTim Peters2002-08-031-5/+18
| | | | | in the test file. I have docs for heapq.heapify ready to check in, but Jack appears to have left behind a stale lock in the Doc/lib directory.
* Hmm! I thought I checked this in before! Oh well.Tim Peters2002-08-021-1/+19
| | | | | | | | | | | | Added new heapify() function, which transforms an arbitrary list into a heap in linear time; that's a fundamental tool for using heaps in real life <wink>. Added heapyify() test. Added a "less naive" N-best algorithm to the test suite, and noted that this could actually go much faster (building on heapify()) if we had max-heaps instead of min-heaps (the iterative method is appropriate when all the data isn't known in advance, but when it is known in advance the tradeoffs get murkier).
* check_invariant(): Use the same child->parent "formula" used by heapq.py.Tim Peters2002-08-021-2/+2
|
* Don't use true division where int division was intended. For that matter,Tim Peters2002-08-021-1/+1
| | | | don't use division at all.
* Adding the heap queue algorithm, per discussion in python-dev lastGuido van Rossum2002-08-021-0/+48
| | | | week.
* regression test for the whichdb moduleSkip Montanaro2002-08-021-0/+63
|
* testGetServByName shouldn't check for getservbyname - the socket moduleSkip Montanaro2002-08-021-18/+17
| | | | should always have it.
* New test %sort. This takes a sorted list, picks 1% of the list positionsTim Peters2002-08-021-1/+7
| | | | | | | | | | | | | | | | at random, and replaces the elements at those positions with new random values. I was pleasantly surprised by how fast this goes! It's hard to conceive of an algorithm that could special-case for this effectively. Plus it's exactly what happens if a burst of gamma rays corrupts your sorted database on disk <wink>. i 2**i *sort ... %sort 15 32768 0.18 ... 0.03 16 65536 0.24 ... 0.04 17 131072 0.53 ... 0.08 18 262144 1.17 ... 0.16 19 524288 2.56 ... 0.35 20 1048576 5.54 ... 0.77
* modify testGetServByName so it tries a few different protocols. In this daySkip Montanaro2002-08-021-5/+17
| | | | | | and age of rampant computer breakins I imagine there are plenty of systems with telnet disabled. Successful check of at least one getservbyname() call is required for success
* SF patch 588728 (Nathan Srebro).Guido van Rossum2002-08-011-4/+11
| | | | | | | | The __delete__ method wrapper for descriptors was not supported (I added a test, too.) 2.2 bugfix candidate.
* New test for sorting sanity. Note that this will fail in earlier Pythons,Tim Peters2002-08-011-0/+124
| | | | | | | | | | | | | | | | | | | | in the stability tests. Bizarre: this takes 11x longer to run if and only if test_longexp is run before it, on my box. The bigger REPS is in test_longexp, the slower this gets. What happens on your box? It's not gc on my box (which is good, because gc isn't a plausible candidate here). The slowdown is massive in the parts of test_sort that implicitly invoke a new-style class's __lt__ or __cmp__ methods. If I boost REPS large enough in test_longexp, even the test_sort tests on an array of size 64 visibly c-r-a-w-l. The relative slowdown is even worse in a debug build. And if I reduce REPS in test_longexp, the slowdown in test_sort goes away. test_longexp does do horrid things to Win98's management of user address space, but I thought I had made that a whole lot better a month or so ago (by overallocating aggressively in the parser).
* Reverting this to rev 1.3. It's apparently broken everywhere at revTim Peters2002-07-311-5/+5
| | | | 1.6, and pierslauder didn't respond to email about it on Monday.
* Enable test_socket again, if only to prevent mistakes like JeremyGuido van Rossum2002-07-311-2/+2
| | | | | thinking that he was running his new test by running "make test". Also, I can't get this to fail any more. Your turn. :-)
* Repair testNtoH for large long arguments.Jeremy Hylton2002-07-311-9/+8
| | | | | | If the long is large enough, the return value will be a negative int. In this case, calling the function a second time won't return the original value passed in.
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-3045-56/+77
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).Thomas Heller2002-07-301-0/+3
| | | | | | | | | See there for a description. Added test case. Bugfix candidate for 2.2.x, not sure about previous versions: probably low priority, because virtually no one runs debug builds.
* Fix forMichael W. Hudson2002-07-292-0/+6
| | | | | | [ 587875 ] crash on deleting extended slice The array code got simpler, always a good thing!
* Fix the problem of not raising a TypeError exception when doing:Neal Norwitz2002-07-281-1/+7
| | | | | | | | '%g' % '1' '%d' % '1' Add a test for these conditions Fix the test so that if not exception is raise, this is a failure
* remove redundant importPiers Lauder2002-07-271-1/+0
|
* remove redundant codePiers Lauder2002-07-271-1/+1
|
* remove o/s dependancy from testPiers Lauder2002-07-271-4/+5
|
* Reorganized so the test is skipped if os.popen() doesn't exist (in stead of ↵Jack Jansen2002-07-261-4/+4
| | | | failing).
* Remove duplicate checks of the Node.allnodes variable.Fred Drake2002-07-251-3/+0
|
* Extended socket.htonl and ntohl to accept longs.Jeremy Hylton2002-07-251-0/+11
| | | | | | | Fixes SF bug #568322. The code should raise an OverflowError if the long is > 32 bits, even on platforms where sizeof(long) > 4.
* Remove test that was none too picky about whether attributes exist.Jeremy Hylton2002-07-251-41/+0
|