summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Another "if 0:" hack, this time to complain about otherwise invisibleTim Peters2001-06-281-0/+33
| | | | | | "return expr" instances in generators (which latter may be generators due to otherwise invisible "yield" stmts hiding in "if 0" blocks). This was fun the first time, but this has gotten truly ugly now.
* This no longer leaks memory when run in an infinite loop. However,Tim Peters2001-06-271-81/+58
| | | | | | | | | | | | | | | | | | | | | that required explicitly calling LazyList.clear() in the two tests that use LazyList (I added a LazyList Fibonacci generator too). A real bitch: the extremely inefficient first version of the 2-3-5 test *looked* like a slow leak on Win98SE, but it wasn't "really": it generated so many results that the heap grew over 4Mb (tons of frames! the number of frames grows exponentially in that test). Then Win98SE malloc() starts fragmenting address space allocating more and more heaps, and the visible memory use grew very slowly while the disk was thrashing like mad. Printing fewer results (i.e., keeping the heap burden under 4Mb) made that illusion vanish. Looks like there's no hope for plugging the LazyList leaks automatically short of adding frameobjects and genobjects to gc. OTOH, they're very easy to break by hand, and they're the only *kind* of plausibly realistic leaks I've been able to provoke. Dilemma.
* Encode surrogates in UTF-8 even for a wide Py_UNICODE.Martin v. Löwis2001-06-271-2/+2
| | | | | | | Implement sys.maxunicode. Explicitly wrap around upper/lower computations for wide Py_UNICODE. When decoding large characters with UTF-8, represent expected test results using the \U notation.
* gen_getattr: make the gi_running and gi_frame members discoverable (butTim Peters2001-06-261-2/+22
| | | | not writable -- too dangerous!) from Python code.
* Add a bunch of tests for extended dict.update() where the argument isBarry Warsaw2001-06-261-0/+70
| | | | | a non-dictionary mapping object. Include tests for several expected failure modes.
* SF bug #436207: "if 0: yield x" is ignored.Tim Peters2001-06-261-7/+128
| | | | Not anymore <wink>. Pure hack. Doesn't fix any other "if 0:" glitches.
* Teach the types module about generators. Thanks to James Althoff on theTim Peters2001-06-251-0/+20
| | | | Iterators list for bringing it up!
* Repair indentation in comment.Tim Peters2001-06-251-2/+9
| | | | Add a temporary driver to help track down remaining leak(s).
* Added a "generate k-combinations of a list" example posted to c.l.py.Tim Peters2001-06-241-1/+49
|
* New tests to provoke SyntaxErrors unique to generators. Minor fiddlingTim Peters2001-06-241-6/+85
| | | | of other tests.
* Another variant of the 2-3-5 test, mixing generators with a LazyList class.Tim Peters2001-06-241-0/+37
| | | | | | | Good news: Some of this stuff is pretty sophisticated (read nuts), and I haven't bumped into a bug yet. Bad news: If I run the doctest in an infinite loop, memory is clearly leaking.
* More tests.Tim Peters2001-06-241-1/+68
|
* Add a recursive Sieve of Eratosthenes prime generator. Not practical,Tim Peters2001-06-231-1/+39
| | | | but it's a heck of a good generator exerciser (think about it <wink>).
* Add all the examples from PEP 255, and a few email examples.Tim Peters2001-06-231-2/+183
|
* New std test for generators, initially populated with doctests NeilS putTim Peters2001-06-231-0/+139
| | | | together.
* Teach the UNPACK_SEQUENCE opcode how to tease an iterable object intoTim Peters2001-06-211-0/+53
| | | | | giving up the goods. NEEDS DOC CHANGES
* Add a bunch of sample strings to test soft line breaks of varying endBarry Warsaw2001-06-191-1/+28
| | | | cases.
* The test used int(time.time()) to get a random number, but this doesn't work ↵Jack Jansen2001-06-191-1/+1
| | | | on the mac (where times are bigger than ints). Changed to int(time.time()%1000000).
* Test by Martin v. Loewis for the new UTF-16 codec handling of BOMMarc-André Lemburg2001-06-191-0/+25
| | | | marks.
* A unittest-based test for the quopri module.Barry Warsaw2001-06-191-0/+112
|
* Added "i" and "l" to the list of std-mode struct codes that don't range-Tim Peters2001-06-181-1/+4
| | | | | check correctly on pack(). While these were checking OK on my 32-bit box, Mark Favas reported failures on a 64-bit box (alas, easy to believe).
* SF bug 434186: 0x80000000/2 != 0x80000000>>1Tim Peters2001-06-181-0/+7
| | | | | | | | | i_divmod: New and simpler algorithm. Old one returned gibberish on most boxes when the numerator was -sys.maxint-1. Oddly enough, it worked in the release (not debug) build on Windows, because the compiler optimized away some tricky sign manipulations that were incorrect in this case. Makes you wonder <wink> ... Bugfix candidate.
* Generalize the new qQ std-mode tests to all int codes (bBhHiIlLqQ).Tim Peters2001-06-131-158/+202
| | | | | | | | Unfortunately, the std-mode bBhHIL codes don't do any range-checking; if and when some of those get fixed, remove their letters from the IntTester.BUGGY_RANGE_CHECK string. In the meantime, a msg saying that range-tests are getting skipped is printed to stdout whenever one is skipped.
* The new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.Tim Peters2001-06-131-0/+6
| | | | Repaired that, and added appropriate tests for it to test_struct.py.
* Added q/Q standard (x-platform 8-byte ints) mode in struct module.Tim Peters2001-06-121-6/+165
| | | | | | | | | | | | | | This completes the q/Q project. longobject.c _PyLong_AsByteArray: The original code had a gross bug: the most-significant Python digit doesn't necessarily have SHIFT significant bits, and you really need to count how many copies of the sign bit it has else spurious overflow errors result. test_struct.py: This now does exhaustive std q/Q testing at, and on both sides of, all relevant power-of-2 boundaries, both positive and negative. NEWS: Added brief dict news while I was at it.
* Renamed some stuff to tell the truth about what it does.Tim Peters2001-06-101-4/+4
|
* Initial support for 'q' and 'Q' struct format codes: for now, only inTim Peters2001-06-101-10/+47
| | | | | | | | | | | | | | | | | | native mode, and only when config #defines HAVE_LONG_LONG. Standard mode will eventually treat them as 8-byte ints across all platforms, but that likely requires a new set of routines in longobject.c first (while sizeof(long) >= 4 is guaranteed by C, there's nothing in C we can rely on x-platform to hold 8 bytes of int, so we'll have to roll our own; I'm thinking of a simple pair of conversion functions, Python long to/from sized vector of unsigned bytes; that may be useful for GMP conversions too; std q/Q would call them with size fixed at 8). test_struct.py: In addition to adding some native-mode 'q' and 'Q' tests, got rid of unused code, and repaired a non-portable assumption about native sizeof(short) (it isn't 2 on some Cray boxes). libstruct.tex: In addition to adding a bit of 'q'/'Q' docs (more needed later), removed an erroneous footnote about 'I' behavior.
* Convert the parser module test to use PyUnit.Fred Drake2001-06-042-300/+212
|
* Implement testGetElementsByTagNameNS.Martin v. Löwis2001-06-032-1/+9
|
* lookdict: stop more insane core-dump mutating comparison cases. ShouldTim Peters2001-06-031-0/+68
| | | | | | | be possible to provoke unbounded recursion now, but leaving that to someone else to provoke and repair. Bugfix candidate -- although this is getting harder to backstitch, and the cases it's protecting against are mondo contrived.
* Fix comment.Tim Peters2001-06-021-1/+1
|
* Coredumpers from Michael Hudson, mutating dicts while printing orTim Peters2001-06-021-1/+65
| | | | | converting to string. Critical bugfix candidate -- if you take this seriously <wink>.
* This division test was too stringent in its accuracy expectations forTim Peters2001-05-291-4/+4
| | | | | | | random inputs: if you ran the test 100 times, you could expect it to report a bogus failure. So loosened its expectations. Also changed the way failing tests are printed, so that when run under regrtest.py we get enough info to reproduce the failure.
* BadDictKey test: The output file expected "raising error" to be printedTim Peters2001-05-291-1/+10
| | | | | | | | | | | exactly once. But the test code can't know that, as the number of times __cmp__ is called depends on internal details of the dict implementation. This is especially nasty because the __hash__ method returns the address of the class object, so the hash codes seen by the dict can vary across runs, causing the dict to use a different probe order across runs. I just happened to see this test fail about 1 run in 7 today, but only under a release build and when passing -O to Python. So, changed the test to be predictable across runs.
* runtest(): When generating output, if the result is a single line with theFred Drake2001-05-291-1/+19
| | | | | | name of the test, only write the output file if it already exists (and tell the user to consider removing it). This avoids the generation of unnecessary turds.
* The one-line output files are no longer needed, so do not keep them.Fred Drake2001-05-291-1/+0
|
* Variety of test cases for call to builtin functionsJeremy Hylton2001-05-292-0/+126
|
* Whitespace normalization.Tim Peters2001-05-291-1/+0
|
* Jack Jansen hit a bug in the new dict code, reported on python-dev.Tim Peters2001-05-231-0/+15
| | | | | | | | | | dictresize() was too aggressive about never ever resizing small dicts. If a small dict is entirely full, it needs to rebuild it despite that it won't actually resize it, in order to purge old dummy entries thus creating at least one virgin slot (lookdict assumes at least one such exists). Also took the opportunity to add some high-level comments to dictresize.
* When Tim untabified this file, his editor accidentally assumed 4-spaceGuido van Rossum2001-05-231-4/+4
| | | | | tabs. The title was centered using 8-byte tabs, however, and the result looked strange. Fixed this.
* Remove test_doctest's expected-output file.Tim Peters2001-05-234-330/+101
| | | | | | Change test_doctest and test_difflib to pass regrtest's notion of verbosity on to doctest. Add explanation for a dozen "new" things to test/README.
* Update to reflect recent changes to regrtest and the new approaches toFred Drake2001-05-231-7/+55
| | | | testing using doctest and PyUnit.
* Remove test_difflib's output file and change test_difflib to stopTim Peters2001-05-232-281/+1
| | | | | generating it. Since this is purely a doctest, the output file never served a good purpose.
* Remove output files that are no longer needed since the correspondingFred Drake2001-05-222-11/+0
| | | | tests were moved to PyUnit.
* Move the sha tests to PyUnit.Fred Drake2001-05-222-22/+20
|
* Convert binhex regression test to PyUnit. We could use a better testFred Drake2001-05-221-40/+38
| | | | for this.
* Convert copy_reg test to PyUnit.Fred Drake2001-05-221-29/+19
|
* Remove unused import.Fred Drake2001-05-221-1/+0
|
* Simple conversion to PyUnit -- this test really needs more work!Fred Drake2001-05-221-9/+14
|
* Convert dospath test suite to PyUnit, adding a couple more cases forFred Drake2001-05-221-46/+55
| | | | isabs() (no false results were checked) and splitdrive().