Commit Graph

695 Commits

Author SHA1 Message Date
Fred Drake 79ca79d1a9 Add a minimal test suite for the parser module. 2000-08-21 22:30:53 +00:00
Fred Drake 62c53ddabe Add TestSkipped as another interesting item defined by test_support. 2000-08-21 16:55:57 +00:00
Barry Warsaw efc92eec33 PEP 214, Extended print Statement, has been accepted by the BDFL.
Additional test cases for the extended print form.
2000-08-21 15:46:50 +00:00
Tim Peters e82e7ccdbd Remove the winreg module from the project. I don't believe any
docs changes are needed (only reference to winreg I could find
was in libwinreg.tex, which is documenting _winreg, and merely
mentions that a higher-level winreg module *may* appear someday;
that's still true).
2000-08-21 02:27:22 +00:00
Tim Peters 571bb8fc72 David Goodger's new getopt test module (thanks, David!).
https://sourceforge.net/patch/?func=detailpatch&patch_id=101110&group_id=5470
Accepted as-is, except for purging an "import *".
2000-08-20 04:18:40 +00:00
Moshe Zadka 514a1028a2 Adding tests of the "attrs" optional argument, and of the js_output
functionality.
2000-08-19 15:57:33 +00:00
Andrew M. Kuchling cdec8c746b Test case for Cookie.py 2000-08-19 15:21:12 +00:00
Fred Drake 8ae9ce5e5b Better conformance to the Python Style Guide: use spaces around operators. 2000-08-18 16:09:56 +00:00
Fred Drake fe5c22a85e When a KeyboardInterrupt is caught, just use the "raise" syntax to
re-raise it instead of re-raising it "manually" the ugly way.
2000-08-18 16:04:05 +00:00
Fred Drake b65b006595 Convert some old-style string exceptions to class exceptions. 2000-08-18 14:50:20 +00:00
Thomas Wouters 5215225ea1 Apply SF patch #101135, adding 'import module as m' and 'from module import
name as n'. By doing some twists and turns, "as" is not a reserved word.

There is a slight change in semantics for 'from module import name' (it will
now honour the 'global' keyword) but only in cases that are explicitly
undocumented.
2000-08-17 22:55:00 +00:00
Thomas Wouters 1d75a79c00 Apply SF patch #101029: call __getitem__ with a proper slice object if there
is no __getslice__ available. Also does the same for C extension types.
Includes rudimentary documentation (it could use a cross reference to the
section on slice objects, I couldn't figure out how to do that) and a test
suite for all Python __hooks__ I could think of, including the new
behaviour.
2000-08-17 22:37:32 +00:00
Fred Drake 56221a7cfa Chris Herborth <chrish@pobox.com>:
Minor updates for BeOS R5.

Use of OSError in test.test_fork1 changed to TestSkipped, with corresponding
change in BeOS/README (by Fred).

This closes SourceForge patch #100978.
2000-08-15 18:52:33 +00:00
Fred Drake a64436e853 Update test output to reflect change in SyntaxError formatting.
This closes SourceForge bug #110628 (Jitterbug PR#278).
2000-08-15 15:51:18 +00:00
Barry Warsaw 97ca66fd57 tests for binascii.b2a_hex() and binascii.a2b_hex(). 2000-08-15 06:08:31 +00:00
Barry Warsaw 3fdcccb82f Added a test of the md5.hexdigest() method. Funny enough, this test
had yet-another Python implementation of a binary-data-to-hex-digit
encoder!
2000-08-15 06:01:36 +00:00
Mark Hammond 041307d95c Remove the test for abspath with an empty path - too hard to do in a cross-platform manner. 2000-08-14 23:06:37 +00:00
Mark Hammond 673c6cf3d4 Test for fix to bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName()) 2000-08-14 06:21:26 +00:00
Mark Hammond 0d0b1e93e1 Check in the correct output - even though the module itself may not survive! 2000-08-14 06:05:40 +00:00
Skip Montanaro 803d6e5451 list comprehensions. see
http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470

for details.
2000-08-12 18:09:51 +00:00
Trent Mick f29f47b38b Add largefile support for Linux64 and WIn64. Add test_largefile and some minor
change to regrtest.py to allow optional running of test_largefile ('cause it's
slow on Win64).

This closes patches:
http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100510&group_id=5470
and
http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100511&group_id=5470
2000-08-11 19:02:59 +00:00
Peter Schneider-Kamp 10e1bf2f64 remove all occurence of math.rint() from the sources
(and yes, "Currintly" also counts <0.5 wink>)
2000-08-10 04:23:30 +00:00
Fredrik Lundh 5810064476 -- changed findall to return empty strings instead of None
for undefined groups
2000-08-09 09:14:35 +00:00
Fredrik Lundh 8e6d571a7c -- enabled some temporarily disabled RE tests
-- added basic unicode tests to test_re
-- added test case for Sjoerd's xmllib problem to re_tests
2000-08-08 17:06:53 +00:00
Fredrik Lundh 2643b55a77 -- whitespace cleanup (real changes coming in next checkin) 2000-08-08 16:52:51 +00:00
Fredrik Lundh 1151a8cd61 -- whitespace cleanup (more tests to be added in the next commit) 2000-08-08 16:47:42 +00:00
Guido van Rossum 79c9b17d17 Barry's patch to test the new setdefault() method. 2000-08-08 16:13:23 +00:00
Marc-André Lemburg e5034378cc Removing UTF-16 aware Unicode comparison code. This kind of compare
function (together with other locale aware ones) should into a new collation
support module. See python-dev for a discussion of this removal.

Note: This patch should also be applied to the 1.6 branch.
2000-08-08 08:04:29 +00:00
Vladimir Marangozov f9d20c3786 Neil Schemenauer: GC enable(), disable(), isenabled() interface.
Small stylistic changes by VM:
- is_enabled() -> isenabled()
- static ... Py_<func> -> static ... gc_<func>
2000-08-06 22:45:31 +00:00
Moshe Zadka 92a69138b3 Oooopsss.....tab and space mismatch corrected. 2000-08-04 15:25:58 +00:00
Thomas Wouters b9fa0a843e Raise 'TestSkipped' (from the test_support) module rather than 'ImportError'
to signify a test that should be marked as 'skipped' rather than 'failed'.
Also 'document' it, in README.
2000-08-04 13:34:43 +00:00
Moshe Zadka 040c17fe38 Raise TestSkipped, not ImportError.
Honesty's the best policy.
2000-08-04 13:26:03 +00:00
Thomas Wouters 3af826ebca Make test_support.TestSkipped errors work the same way as ImportErrors:
mark the test as 'skipped', rather than 'failed'.
2000-08-04 13:17:51 +00:00
Moshe Zadka 323a5086ae In case the user isn't allowed to access /dev/dsp or /dev/dsp isn't there
at all (my computer doesn't have a Sound Blaster), this doesn't mean
there's a bug in linuxaudiodev. The only error the test suite skips
is currently ImportError -- so that's what we raise. If you see a problem
with this patch, say so and I'll retract. If you think raising an ImportError
sucks, you're right -- but I ain't gonna buy a SB and I sure ain't gonna
let the test-suite fail on my machine.
2000-08-04 12:59:40 +00:00
Jeremy Hylton d9827c476c test the non-multipart sections of the cgi module 2000-08-03 22:11:43 +00:00
Moshe Zadka 73ed8e566e Checking in empty tests for urlparse, as future place holders 2000-08-03 17:28:50 +00:00
Fredrik Lundh 96ab46529b -- added recursion limit (currently ~10,000 levels)
-- improved error messages
-- factored out SRE_COUNT; the same code is used by
   SRE_OP_REPEAT_ONE_TEMPLATE
-- minor cleanups
2000-08-03 16:29:50 +00:00
Barry Warsaw a873b03ebb Added a -l/--leakdebug option which turns on DEBUG_LEAK if the gc
module is importable.
2000-08-03 15:50:37 +00:00
Barry Warsaw e027d8dc81 Added output for testsuite for new zip() builtin. 2000-08-03 15:48:31 +00:00
Barry Warsaw 7bfc1a1507 Added testsuite for new zip() builtin. 2000-08-03 15:48:07 +00:00
Andrew M. Kuchling e6f164622f Comment out repeated-group test for the moment 2000-08-03 12:16:29 +00:00
Andrew M. Kuchling a3eacc472c Add nasty test case that overflows the stack with a repeated group 2000-08-03 02:06:45 +00:00
Fredrik Lundh 067bebfe2d -- SRE 0.9.8: now that the bug is fixed, I might as well enable
the test again...
2000-08-01 13:16:55 +00:00
Fredrik Lundh c2ed621d75 -- SRE 0.9.8: updated test scripts 2000-08-01 13:01:43 +00:00
Peter Schneider-Kamp 5a65c2d436 added count, extend, index, pop and remove to arraymodule 2000-07-31 20:52:21 +00:00
Thomas Wouters a701597138 Fix inconsistent use of tab/space in indentation. 2000-07-30 15:38:35 +00:00
Mark Hammond af4cfae300 Test that after resizing the mmap'd file, we can't seek beyond the new size. 2000-07-30 02:20:38 +00:00
Andrew M. Kuchling 85ab7384f6 Exercise .readline() and .readlines(). More data is written to the
test file, too, so the methods have more work to do.
2000-07-29 20:18:34 +00:00
Mark Hammond 152e3f0885 Was quite broken and incomplete. Now passes the test suite, but is still incomplete. 2000-07-28 03:45:32 +00:00
Trent Mick c64c8ea71c Remove erroneous empty trailing line. (cause test_winreg.py failure) 2000-07-27 23:26:28 +00:00
Fredrik Lundh 9407e553c0 -- changed test to work on platforms which have os.popen
but no os.fork
2000-07-27 07:42:43 +00:00
Peter Schneider-Kamp fdee0f0aa7 added test case for fixed duplicate arguments bug in Python/compile.c 2000-07-25 22:15:45 +00:00
Andrew M. Kuchling c1b4624447 Made an error message slightly more useful if select() returns something goofy 2000-07-25 00:51:31 +00:00
Fredrik Lundh 82c330e591 -- updated to include known problems in SRE 0.9.6
(cf. test/output/test_sre)
2000-07-24 22:35:11 +00:00
Fred Drake 1790dd4b66 Restore TestSkipped exception; appears to have disappeared in last checkin.
Make both TextFailed and TestSkipped subclasses of Error, which derives
from Exception.  Docstrings have been added for the exceptions and module.
2000-07-24 06:55:00 +00:00
Fredrik Lundh 8a3ebf8ca8 -- SRE 0.9.6 sync. this includes:
+ added "regs" attribute
 + fixed "pos" and "endpos" attributes
 + reset "lastindex" and "lastgroup" in scanner methods
 + removed (?P#id) syntax; the "lastindex" and "lastgroup"
   attributes are now always set
 + removed string module dependencies in sre_parse
 + better debugging support in sre_parse
 + various tweaks to build under 1.5.2
2000-07-23 21:46:17 +00:00
Skip Montanaro e9e5dcd4db restructured a bit and added some more content... 2000-07-19 17:19:49 +00:00
Skip Montanaro 4d06923122 make TestFailed a class exception 2000-07-19 17:14:48 +00:00
Thomas Wouters baf2663e44 Enable extra testing now that os.isatty() is in. (Also tests os.isatty ;P) 2000-07-19 14:51:54 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Vladimir Marangozov 5ff2ac2fa9 Break a cycle created in the saboteur() function. 2000-07-15 00:42:09 +00:00
Vladimir Marangozov d57f5cff0e Break the cycles after testing cmp() on cyclic objects. 2000-07-14 04:32:09 +00:00
Skip Montanaro 56509a3cb8 new test for posixpath module 2000-07-12 00:20:45 +00:00
Skip Montanaro e809b00f36 new test file for posixpath module 2000-07-12 00:20:08 +00:00
Jeremy Hylton 88887aa38e small updates to string_join:
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-11 20:55:38 +00:00
Fred Drake 85f363990c Create two new exceptions: IndentationError and TabError. These are
used for indentation related errors.  This patch includes Ping's
improvements for indentation-related error messages.

Closes SourceForge patches #100734 and #100856.
2000-07-11 17:53:00 +00:00
Jeremy Hylton fff9e20943 fix bug #42 reported by Andrew Dalke
The Compare close contains a close method that checks to see if there
is any unconsumed data in the Compare instance; i.e. if the canonical
output file contains more data than was produced by the current test
run. This method was never called, allowing differences to go
undetected.

Fix is to call close after the test is run (after __import__)

output/test_long and output/test_popen2 needed trivial changes
output/test_select contained lots of text, but test_select.py produced
    no output
2000-07-11 15:15:31 +00:00
Peter Schneider-Kamp 7a11671e8b fixed inconsistent use of tab and spaces 2000-07-11 11:24:41 +00:00
Andrew M. Kuchling d3cf692c38 Add test of resize() method of mmap objects 2000-07-11 10:45:28 +00:00
Jeremy Hylton 20f41b6456 add more tests of string.join variants to run_method_tests 2000-07-11 03:31:55 +00:00
Jeremy Hylton f82b04ecbb factor out test definitions to string_tests module
test_string and test_userstring run same tests for string methods
2000-07-10 17:08:42 +00:00
Guido van Rossum 1bbddd085c Added the line 'Testing UTF-16 code point order comparisons... done."
to match addition to test_unicode.py.
2000-07-10 15:06:06 +00:00
Jeremy Hylton a5ae490584 expect message "no regression test case for method 'encode' 2000-07-10 14:14:40 +00:00
Marc-André Lemburg d6d06ade26 Tests for new surrogate support in the UTF-8 codec. By Bill Tutt. 2000-07-07 17:48:52 +00:00
Marc-André Lemburg b6d78fcd9c Tests for new instance support in unicode(). 2000-07-07 13:46:19 +00:00
Marc-André Lemburg 9d4674168f Added tests for the new .isalpha() and .isalnum() methods. 2000-07-05 09:46:40 +00:00
Paul Prescod 99b84bdaad Removed some tabs. 2000-07-04 03:38:10 +00:00
Fredrik Lundh 72b82ba16d - fixed grouping error bug
- changed "group" operator to "groupref"
2000-07-03 21:31:48 +00:00
Fredrik Lundh 6f01398236 - added lookbehind support (?<=pattern), (?<!pattern).
the pattern must have a fixed width.

- got rid of array-module dependencies; the match pro-
  gram is now stored inside the pattern object, rather
  than in an extra string buffer.

- cleaned up a various of potential leaks, api abuses,
  and other minors in the engine module.

- use mal's new isalnum macro, rather than my own work-
  around.

- untabified test_sre.py.  seems like I removed a couple
  of trailing spaces in the process...
2000-07-03 18:44:21 +00:00
Fred Drake 17647f5201 Compute the name of the test file so that it can be found both when this
test is run as a script and when imported via the regression test
framework.

Problem reported by Phillip Porch <root@theporch.com>.
2000-07-03 16:37:42 +00:00
Paul Prescod ebc0473c05 Fixed test output 2000-07-01 19:17:43 +00:00
Paul Prescod 7993bcc040 Added minidom tests. 2000-07-01 14:54:16 +00:00
Guido van Rossum 54610f31cc output for openpty test 2000-07-01 03:34:14 +00:00
Guido van Rossum a0f7e8574c Thomas Wouters: Test script for openpty() 2000-07-01 01:13:31 +00:00
Fred Drake 4c136eefab Thomas Wouters <thomas@xs4all.net>:
Test case for the pty module.
2000-06-30 23:22:35 +00:00
Fred Drake 96fee02917 Output for test_winreg2.
Someone who knows what they are doing needs to replace this with something
that makes sense -- I'm not running Windows right now.
2000-06-30 19:38:16 +00:00
Fred Drake 2658d15d45 Paul Prescod <paul@prescod.net>:
Regression test for the new winreg.py module.

[Could a Windows person someone please review this?]
2000-06-30 19:36:23 +00:00
Fredrik Lundh 4ccea94152 - reverted to "\x is binary byte"
- removed evil tabs from sre_parse and sre_compile
2000-06-30 18:39:20 +00:00
Skip Montanaro ab1c7918f6 * added a randomize flag and corresponding -r command line argument that
allows the caller to execute the various tests in pseudo-random order -
  default is still to execute tests in the order returned by findtests().

* moved initialization of the various flag variables to the main() function
  definition, making it possible to execute regrtest.main() interactively
  and still override default behavior.
2000-06-30 16:39:27 +00:00
Guido van Rossum 2850d18615 Switch to sre for regular expression matching (the new mini-re module
is actually by Fredrik Lundh).  This will break the re tests --
Fredrik will fix this before the final release.
2000-06-30 16:25:20 +00:00
Jeremy Hylton 094c9e587c remove all prints (since the prints where of memory locations) 2000-06-30 15:13:15 +00:00
Fredrik Lundh 0640e1161f the mad patcher strikes again:
-- added pickling support (only works if sre is imported)

-- fixed wordsize problems in engine
   (instead of casting literals down to the character size,
   cast characters up to the literal size (same as the code
   word size).  this prevents false hits when you're matching
   a unicode pattern against an 8-bit string. (unfortunately,
   this broke another test, but I think the test should be
   changed in this case; more on that on python-dev)

-- added sre.purge function
   (unofficial, clears the cache)
2000-06-30 13:55:15 +00:00
Fredrik Lundh 43b3b49b5a - fixed lookahead assertions (#10, #11, #12)
- untabified sre_constants.py
2000-06-30 10:41:31 +00:00
Marc-André Lemburg 587794b386 Marc-Andre Lemburg <mal@lemburg.com>:
Added test output.
2000-06-30 10:28:32 +00:00
Marc-André Lemburg d70141a2d9 Marc-Andre Lemburg <mal@lemburg.com>:
New test for huge formatting strings (these could cause core
dumps in previous versions).

By Trent Mick.
2000-06-30 10:26:29 +00:00
Marc-André Lemburg 6cdec2efbb New test for the ucnhash module. 2000-06-30 09:45:20 +00:00
Marc-André Lemburg 5f2e75e87c Marc-Andre Lemburg <mal@lemburg.com>:
Updated test output (the ucn tests are now in test_ucn).
2000-06-30 09:14:13 +00:00
Marc-André Lemburg af69f15d21 Marc-Andre Lemburg <mal@lemburg.com>:
Moved tests of new Unicode Char Name support to a separate test.
2000-06-30 09:13:35 +00:00
Fredrik Lundh b71624e698 - added support for (?P=name)
(closes #3 and #7 from the status report)
2000-06-30 09:13:06 +00:00
Fredrik Lundh 90a0791322 - pedantic: make sure "python -t" doesn't complain... 2000-06-30 07:50:59 +00:00
Fredrik Lundh df02d0b3f0 - fixed default value handling in group/groupdict
- added test suite
2000-06-30 07:08:20 +00:00
Skip Montanaro 47c60ec9a0 Describe a bit about writing test cases for Python... 2000-06-30 06:08:35 +00:00
Jeremy Hylton c5007aa5c3 final patches from Neil Schemenauer for garbage collection 2000-06-30 05:02:53 +00:00
Fred Drake 252af9ca27 The low-level interface is now in _winreg; update the import here. 2000-06-29 19:42:00 +00:00
Fred Drake 13634cf7a4 This patch addresses two main issues: (1) There exist some non-fatal
errors in some of the hash algorithms. For exmaple, in float_hash and
complex_hash a certain part of the value is not included in the hash
calculation. See Tim's, Guido's, and my discussion of this on
python-dev in May under the title "fix float_hash and complex_hash for
64-bit *nix"

(2) The hash algorithms that use pointers (e.g. func_hash, code_hash)
are universally not correct on Win64 (they assume that sizeof(long) ==
sizeof(void*))

As well, this patch significantly cleans up the hash code. It adds the
two function _Py_HashDouble and _PyHash_VoidPtr that the various
hashing routine are changed to use.

These help maintain the hash function invariant: (a==b) =>
(hash(a)==hash(b))) I have added Lib/test/test_hash.py and
Lib/test/output/test_hash to test this for some cases.
2000-06-29 19:17:04 +00:00
Guido van Rossum 1bfdc78c84 Skip Montanaro: modify test_socket.py to listen/connect using loopback addr 2000-06-29 17:00:54 +00:00
Marc-André Lemburg a2aa34f243 Marc-Andre Lemburg <mal@lemburg.com>:
New test output
2000-06-29 13:31:10 +00:00
Fred Drake 7833447f8f Trent Mick <trentm@activestate.com>:
Testing: test_array.py was also extended to check that one can set the
full range of values for each of the integral signed and unsigned
array types.

This closes SourceForge patch #100506.
2000-06-28 17:50:51 +00:00
Marc-André Lemburg 4a9188c557 Marc-Andre Lemburg <mal@lemburg.com>:
Updated test output.
2000-06-28 16:41:46 +00:00
Marc-André Lemburg a6f73d64c5 Marc-Andre Lemburg <mal@lemburg.com>:
Added tests for the new Unicode character name support in the
standard unicode-escape codec.
2000-06-28 16:41:23 +00:00
Fred Drake c19425d520 Added the atexit module and documentation from Skip Montanaro
<skip@mojam.com>.  Revisions to the markup to make it pass LaTeX, added
an index entry and a reference from the sys.exitfunc documentation.

This closes SourceForge patch #100620.
2000-06-28 15:07:31 +00:00
Jeremy Hylton a05e293a21 typos fixed by Rob Hooft 2000-06-28 14:48:01 +00:00
Andrew M. Kuchling 7fd7e36b08 Change pyexpat test suite to exercise the .returns_unicode attribute,
parsing the sample data once with 8-bit strings and once with Unicode.
2000-06-27 00:37:25 +00:00
Jeremy Hylton c380466762 update output file to reflect new test of exception object str-ness 2000-06-25 10:44:57 +00:00
Jeremy Hylton 3c0d013db4 verify that Python raises SyntaxError for long and deeply-nested expressions 2000-06-20 19:13:27 +00:00
Jeremy Hylton 56c807d318 add minimal test of exception use. verify that each exception can be
raised, caught, and converted to a string.
2000-06-20 18:52:57 +00:00
Andrew M. Kuchling cf70ea633f Additional tests for seek() method, written by Trent Mick 2000-06-18 04:47:08 +00:00
Marc-André Lemburg bddf502a1f Marc-Andre Lemburg <mal@lemburg.com>:
Removed a test which can fail when the default locale setting
uses a Latin-1 encoding. The test case is not applicable anymore.
2000-06-14 09:17:25 +00:00
Marc-André Lemburg 8462573826 Marc-Andre Lemburg <mal@lemburg.com>:
Fixed some tests to not cause the script to fail, but rather
output a warning (which then is caught by regrtest.py as wrong
output). This is needed to make test_unicode.py run through
on JPython.
Thanks to Finn Bock.
2000-06-13 12:05:36 +00:00
Fred Drake 1f2d4640b8 Added test for linnuxaudiodev module; directly adapted from sunaudiodev
test.  Someone with more Linux audio knowledge should at least take a
brief look at it.
2000-06-10 04:22:57 +00:00
Marc-André Lemburg 59a044b7d2 Marc-Andre Lemburg <mal@lemburg.com>:
Updated to the fix in %c formatting: it now always checks for
a one character argument.
2000-06-08 17:50:55 +00:00
Fred Drake 8eded195aa Trent Mick <trentm@activestate.com>:
Fix test of the "math" module so it does not break on platforms that do
not offer rint(); just skip that portion of the test in that case.
2000-06-01 17:59:17 +00:00
Barry Warsaw 992cb8ab53 Added a test to catch the base class. 2000-05-25 23:16:54 +00:00
Guido van Rossum 71260b846e Added math.rint() -- round according to current IEEE754 mode 2000-05-11 18:19:42 +00:00
Fred Drake 774c931c12 M.-A. Lemburg <mal@lemburg.com>:
Added another test for string formatting (the one that
produced the core dump now fixed in unicodeobject.c).
2000-05-09 19:57:46 +00:00
Guido van Rossum 5193114442 Alas, Vladimir's patch was too aggressive, and started causing really
weird errors.  (E.g. see thread "weird bug in test_winreg" in python-dev.)

Since it's actually useful to be able to re-run an individual test
after running test.autotest, we keep the unloading code, but only for
modules whose full name starts with "test.".
2000-05-05 14:27:39 +00:00
Guido van Rossum 4951782178 Raise ImportError when os.fork does not exist. 2000-05-04 00:36:42 +00:00
Guido van Rossum 6650320349 Get rid of memory leak caused by assingning sys.exc_info() to a local.
Store sys.exc_info()[:2] instead.
2000-04-28 20:39:58 +00:00
Jeremy Hylton 7c4f96f442 Deviant1 didn't work as advertised 2000-04-27 21:42:48 +00:00
Jeremy Hylton 035a07e263 add some more contains tests on the builtin types 2000-04-27 21:40:08 +00:00
Guido van Rossum c1488413e4 Added a provision to stop all threads before exiting from the test:
the change to regrtest.py to unload all newly imported modules did
something bad to the threads -- and I realized that they would never
stop!
2000-04-24 14:07:03 +00:00
Guido van Rossum 2512d6d83a Fix spelling error and remove Windows line endings. 2000-04-24 14:01:51 +00:00
Guido van Rossum 5796d26794 Patch by Vladimir Marangozov to unload additionally imported modules
after each test has been run.  This avoids excessive memory growth
during the tests.
2000-04-21 21:35:06 +00:00
Guido van Rossum cdd092fe48 Added test_winsound by Mark Hammond. 2000-04-21 21:28:47 +00:00
Guido van Rossum 84219682fb Charles Waldman writes:
"""
In the course of debugging this I also saw that cPickle is
inconsistent with pickle - if you attempt a pickle.load or pickle.dump
on a closed file, you get a ValueError, whereas the corresponding
cPickle operations give an IOError.  Since cPickle is advertised as
being compatible with pickle, I changed these exceptions to match.
"""
2000-04-21 20:49:58 +00:00
Jeremy Hylton 4a3dd2dcc2 Fix PR#7 comparisons of recursive objects
Note that comparisons of deeply nested objects can still dump core in
extreme cases.
2000-04-14 19:13:24 +00:00
Fred Drake e0243e24be M.-A. Lemburg <mal@lemburg.com>:
Added test for Unicode string concatenation.
2000-04-13 14:11:56 +00:00
Fred Drake afe73a4687 M.-A. Lemburg <mal@lemburg.com>:
Added test output for Unicode string concatenation test.
2000-04-13 14:10:04 +00:00
Guido van Rossum b28bc8cd05 Marc-Andre Lemburg:
Modified .splitlines() tests according to the changes
in stringobject.c.
2000-04-11 15:37:24 +00:00
Guido van Rossum 7ee801d6af Marc-Andre Lemburg:
Modified .splitlines() tests according to the changes
in unicodeobject.c.
2000-04-11 15:37:02 +00:00
Guido van Rossum 6e277cf7de Christian Tismer: added test to ensure that multiplication commutes.
[The test is in a slightly odd place, in test_division_2; but it
exercises the recent change to long_mult(), and that's all we really
ask for.  --GvR]
2000-04-10 17:41:37 +00:00
Fred Drake 1a4b593dd6 Use a constant to specify the number of child threads to create.
Instead of assuming that the number process ids of the threads is the
same as the process id of the controlling process, use a copy of the
dictionary and check for changes in the process ids of the threads
from the thread's process ids in the parent process.  This makes the
test make more sense on systems which assign a new pid to each thread
(i.e., Linux).

This doesn't fix the other problems evident with this test on Linux.
2000-04-10 15:36:39 +00:00
Guido van Rossum 9706486b9f Marc-Andre Lemburg:
* '...%s...' % u"abc" now coerces to Unicode just like
  string methods. Care is taken not to reevaluate already formatted
  arguments -- only the first Unicode object appearing in the
  argument mapping is looked up twice. Added test cases for
  this to test_unicode.py.
2000-04-10 13:52:48 +00:00
Guido van Rossum 45ad3c4897 Marc-Andre Lemburg:
* More test cases for test_contains.py.
2000-04-10 13:52:13 +00:00
Guido van Rossum 4b49101f20 Don't be so strict in checking AttributeError -- the error message
recently changed.
2000-04-10 13:37:14 +00:00
Guido van Rossum 547e952017 Output from test_zipfile.py. 2000-04-10 13:24:00 +00:00
Guido van Rossum 368f04ac46 Test for zipfile.py, by Jim Ahlstrom. 2000-04-10 13:23:04 +00:00
Guido van Rossum 9e896b37c7 Marc-Andre's third try at this bulk patch seems to work (except that
his copy of test_contains.py seems to be broken -- the lines he
deleted were already absent).  Checkin messages:


New Unicode support for int(), float(), complex() and long().

- new APIs PyInt_FromUnicode() and PyLong_FromUnicode()
- added support for Unicode to PyFloat_FromString()
- new encoding API PyUnicode_EncodeDecimal() which converts
  Unicode to a decimal char* string (used in the above new
  APIs)
- shortcuts for calls like int(<int object>) and float(<float obj>)
- tests for all of the above

Unicode compares and contains checks:
- comparing Unicode and non-string types now works; TypeErrors
  are masked, all other errors such as ValueError during
  Unicode coercion are passed through (note that PyUnicode_Compare
  does not implement the masking -- PyObject_Compare does this)
- contains now works for non-string types too; TypeErrors are
  masked and 0 returned; all other errors are passed through

Better testing support for the standard codecs.

Misc minor enhancements, such as an alias dbcs for the mbcs codec.

Changes:
- PyLong_FromString() now applies the same error checks as
  does PyInt_FromString(): trailing garbage is reported
  as error and not longer silently ignored. The only characters
  which may be trailing the digits are 'L' and 'l' -- these
  are still silently ignored.
- string.ato?() now directly interface to int(), long() and
  float(). The error strings are now a little different, but
  the type still remains the same. These functions are now
  ready to get declared obsolete ;-)
- PyNumber_Int() now also does a check for embedded NULL chars
  in the input string; PyNumber_Long() already did this (and
  still does)

Followed by:

Looks like I've gone a step too far there... (and test_contains.py
seem to have a bug too).

I've changed back to reporting all errors in PyUnicode_Contains()
and added a few more test cases to test_contains.py (plus corrected
the join() NameError).
2000-04-05 20:11:21 +00:00
Fred Drake 605843f0c0 Mark Hammond:
This patch fixes the mmap module on Windows 9x.

Also updates the mmap test to remove the test file.
2000-04-05 14:17:11 +00:00
Fred Drake a22b576d05 UserString class from Peter Funk <pf@artcom-gmbh.de>. 2000-04-03 03:51:50 +00:00
Andrew M. Kuchling e188d52a7e Untabified file to fix problems reported by tabnanny 2000-04-02 05:15:38 +00:00
Fred Drake d9b0f26515 Mark Hammond: Uncomment call to delete test data when done. 2000-04-01 05:25:57 +00:00
Andrew M. Kuchling d553e99a74 Added test case output for pyexpat module 2000-03-31 15:45:20 +00:00
Andrew M. Kuchling b17664ddf0 Added test case for pyexpat module that tries to exercise all the handlers 2000-03-31 15:44:52 +00:00
Guido van Rossum 706dbd03bd Mark Hammond: Ooops - even though Win32 handles the same args, there
was a superfluous check for the platform.
2000-03-31 01:20:33 +00:00
Guido van Rossum 767e775a98 Improved test, by Mark Hammond, for Win32. 2000-03-31 01:09:14 +00:00
Jeremy Hylton 6a973c7118 robustify UserList constructor -- will now accept any sequence
add test cases for non-UserList class, tuple, & string
2000-03-31 00:17:46 +00:00
Jeremy Hylton 074c3e62d1 Two fixes for extended call syntax:
If a non-tuple sequence is passed as the *arg, convert it to a tuple
before checking its length.
If named keyword arguments are used in combination with **kwargs, make
a copy of kwargs before inserting the new keys.
2000-03-30 23:55:31 +00:00
Andrew M. Kuchling a35be2f412 Output for simple test case for mmap on Unix; someone needs to write a
Win32 test case.
2000-03-30 21:15:46 +00:00
Andrew M. Kuchling e81b9cfcfe Added simple test case for mmap on Unix; someone needs to write a
Win32 test case
2000-03-30 21:15:29 +00:00
Jeremy Hylton 003663d783 fix previous checkin 2000-03-28 23:53:22 +00:00
Jeremy Hylton aed0d8deb0 add test cases for Greg Ewing's extended call syntax patch 2000-03-28 23:51:17 +00:00
Guido van Rossum de59855da6 Mark Hammond: test suite for new winreg module. 2000-03-28 20:36:51 +00:00
Guido van Rossum 24bdb0474f Marc-Andre Lemburg:
The attached patch set includes a workaround to get Python with
Unicode compile on BSDI 4.x (courtesy Thomas Wouters; the cause
is a bug in the BSDI wchar.h header file) and Python interfaces
for the MBCS codec donated by Mark Hammond.

Also included are some minor corrections w/r to the docs of
the new "es" and "es#" parser markers (use PyMem_Free() instead
of free(); thanks to Mark Hammond for finding these).

The unicodedata tests are now in a separate file
(test_unicodedata.py) to avoid problems if the module cannot
be found.
2000-03-28 20:29:59 +00:00
Guido van Rossum d8855fde88 Marc-Andre Lemburg:
Attached you find the latest update of the Unicode implementation.
The patch is against the current CVS version.

It includes the fix I posted yesterday for the core dump problem
in codecs.c (was introduced by my previous patch set -- sorry),
adds more tests for the codecs and two new parser markers
"es" and "es#".
2000-03-24 22:14:19 +00:00
Guido van Rossum 7e57bc4a5b Fix the test so that connect() and bind() are called with a single
argument: a (host, port) tuple.

Like multi-arg append(), multi-arg connect() and bind() may be ruled out!
2000-03-24 20:54:29 +00:00
Guido van Rossum d8fbcc95d9 Regenerated with test for 'contains'. 2000-03-24 20:42:39 +00:00
Barry Warsaw 51ac58039f On 17-Mar-2000, Marc-Andre Lemburg said:
Attached you find an update of the Unicode implementation.

    The patch is against the current CVS version. I would appreciate
    if someone with CVS checkin permissions could check the changes
    in.

    The patch contains all bugs and patches sent this week and also
    fixes a leak in the codecs code and a bug in the free list code
    for Unicode objects (which only shows up when compiling Python
    with Py_DEBUG; thanks to MarkH for spotting this one).
2000-03-20 16:36:48 +00:00
Guido van Rossum d4d2684240 Marc-Andre Lemburg: Add tests for mixed use of char in string. 2000-03-13 23:21:48 +00:00
Guido van Rossum a831cac7a8 Marc-Andre Lemburg: test script for Unicode implementation. 2000-03-10 23:23:21 +00:00
Guido van Rossum da2361ac1d Add tests for char in string -- including required exceptions for
non-char in string.
2000-03-07 15:52:01 +00:00
Guido van Rossum 7344741117 test_contains output 2000-03-06 21:08:08 +00:00
Guido van Rossum 24512e6a35 Test cases for __contains__ code, by Moshe Zadka. 2000-03-06 21:00:29 +00:00
Guido van Rossum f7221c3a7d Test case for fork1() behavior.
Only the main thread should survive in the child after a fork().
2000-02-25 19:25:05 +00:00
Andrew M. Kuchling 5ebfa2ae9f Add tests to exercise sequence operations (multiplication, indexing,
slicing) using long integers
2000-02-23 22:23:17 +00:00
Guido van Rossum cba04366a4 Added test for new crc32() function. 2000-02-16 21:13:06 +00:00
Fred Drake ad892dc80d Make this pass the -tt test. 2000-02-10 15:31:07 +00:00
Fred Drake a710d6e20c Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.
2000-02-07 17:15:48 +00:00
Fred Drake db1bd5c230 Revise tests to support str(<long int object>) not appending "L". 1999-12-23 15:36:42 +00:00
Guido van Rossum 910d9a0634 Test output.
(XXX perhaps a bit too verbose; in particular it is sensitive to
all the doc strings.)
1999-10-19 19:09:00 +00:00
Guido van Rossum fdecda0123 Rewritten -- this now tests the binascii *except* for the binhex
module, which is tested by test_binhex.py.
1999-10-19 19:08:13 +00:00
Guido van Rossum a0e85b241d Test output for test_binhex.py. 1999-10-19 19:07:33 +00:00
Guido van Rossum 7b8f1abfca This test really only tests the binhex module.
Renamed it and adapted a comment and an error message.
1999-10-19 17:48:54 +00:00
Guido van Rossum ba508a21e0 Add test case for bug just fixed by Stephen Turner. 1999-07-13 15:23:42 +00:00
Barry Warsaw 7c5b9d1fa9 added a test for "To: :" patch 1999-07-12 18:47:00 +00:00
Guido van Rossum 47ac4e6b41 Add the test case provided by Barry Scott for his patch. 1999-06-15 18:56:46 +00:00
Barry Warsaw 6e1d78a181 Added a couple of endswith test cases for bugs reported by Timbot.
Also added a short circuit for the regression test suite since CVS
insisted on putting this file in the main branch. :(
1999-06-15 16:49:11 +00:00
Barry Warsaw d5258681e7 Added more tests of join 1999-06-14 18:38:42 +00:00
Barry Warsaw 122473fc70 Two extra startswith tests 1999-06-11 17:51:13 +00:00
Barry Warsaw 8a9514a660 Harness can now test object methods directly, if they aren't available
in the string module.

Add a bunch of new tests for extended startswith/endswith arguments.
1999-06-11 17:48:07 +00:00
Barry Warsaw 4afdb0a89a Output for the regression test of the new string methods. 1999-06-10 22:53:23 +00:00
Barry Warsaw 50f0e16d1b Regression test for the new string methods. 1999-06-10 22:53:10 +00:00
Guido van Rossum 3ed1be9fbd Regression test for date format code, by Mike Meyer.
(I tweaked it slightly so examples are allowed to have no date too.)
1999-05-03 19:57:01 +00:00
Fred Drake 5712fa9250 Added test case that includes a comma in the full name. This tests
for an old bug that's been gone a while, but was still documented
until a few minutes from now.
1999-04-28 17:38:31 +00:00
Guido van Rossum 0cf46bc0f4 Daniel Neri: OpenBSD is just as BSD'ish as the other BSD's ;-) 1999-04-19 17:22:12 +00:00
Guido van Rossum 0b7dd08d50 # Bah. The same problem occurred a second time. 1999-04-08 20:22:46 +00:00
Guido van Rossum 9b112799bc On Windows, we suddenly find, strftime() may return "" for an
unsupported format string.  (I guess this is because the logic for
deciding whether to reallocate the buffer or not has been improved.)
This caused the test code to crash on result[0].  Fix this by assuming
an empty result also means the format is not supported.
1999-04-08 17:23:11 +00:00
Guido van Rossum 052364b20b Use binary mode for all gzip files we open. 1999-04-07 19:00:58 +00:00
Guido van Rossum 630a9a6894 Fix the tests now that splitdrive() no longer treats UNC paths special.
(Some tests converted to splitunc() tests.)
1999-04-06 19:38:18 +00:00
Guido van Rossum 8ff764f113 Jonathan Giddy write:
In test_cpickle.py, the module os got imported, but the line to remove
the temp file has gone missing.
1999-04-01 15:32:30 +00:00