Commit Graph

623 Commits

Author SHA1 Message Date
Barry Warsaw c79dff679f Added an "import xml.parsers.expat" to turn errors due to not having
the parser built into ImportErrors.
2000-09-26 18:00:20 +00:00
Marc-André Lemburg 6c8e4c3ee8 Test output data for the Unicode database test suite. 2000-09-26 16:19:27 +00:00
Marc-André Lemburg 6a20ee7dec Added test suite for the complete Unicode database. The test previously
only tested a few cases.
2000-09-26 16:18:58 +00:00
Guido van Rossum de33c79fdb HP-UX is another one of those platforms using an alternative lock
structure (same as AIX).
2000-09-26 00:31:18 +00:00
Barry Warsaw 38bfc4d0d5 Add a test for SF bug #110621; stripping square brackets off of
addresses with domain literals.
2000-09-25 15:09:28 +00:00
Lars Gustäbel 424980fd4d Enabled EntityResolver test again now that pyexpat.c has been fixed. 2000-09-24 20:57:04 +00:00
Martin v. Löwis 33315b180b Use findfile to locate input and output files. 2000-09-24 20:30:24 +00:00
Lars Gustäbel e292a24589 Added EntityResolver and DTDHandler (patch 101631) with test cases. 2000-09-24 20:19:45 +00:00
Lars Gustäbel 716efea181 Added necessary test input file for test_sax.py 2000-09-24 18:57:26 +00:00
Lars Gustäbel b7536d5860 Added test cases for the InputSource class. 2000-09-24 18:53:56 +00:00
Lars Gustäbel ab64787dca Added test cases for the Attributes interface. 2000-09-24 18:40:52 +00:00
Fredrik Lundh 19f977ba40 - don't hang if group id is followed by whitespace (closes bug #114660) 2000-09-24 14:46:23 +00:00
Lars Gustäbel 96753b3482 Added first start on SAX 2.0 tests. 2000-09-24 12:24:24 +00:00
Fred Drake 7fbc85c5c5 Rename the public interface from "pyexpat" to "xml.parsers.expat". 2000-09-23 04:47:56 +00:00
Neil Schemenauer ef5f2b9dbb - plug a memory leak due to circular lists 2000-09-22 15:30:16 +00:00
Neil Schemenauer d569f23da9 - Replace debugleak flag with findleaks flag. The new SAVEALL GC option is
used to find cyclic garbage produced by tests.
2000-09-22 15:29:28 +00:00
Neil Schemenauer faae266e89 - Add test for new SAVEALL debugging flag
- Use exceptions rather than asserts for failing tests.
- Reorganize tests and produce some output if verbose option is set.
2000-09-22 15:26:20 +00:00
Guido van Rossum c77593d31a Get rid of the one tab in the file.
Closes Bug #115054.
2000-09-22 09:23:08 +00:00
Fred Drake 265a804af2 Revise the test case for pyexpat to avoid using asserts. Conform better
to the Python style guide, and remove unneeded imports.
2000-09-21 20:32:13 +00:00
Guido van Rossum 9e79a25b8a The minidom.Node class has a debug attribute which, when its _debug
flag is true, is set to a StringIO object that silently collects all
debug messages.  This is triggered by the Node._debug=1 statement at
the top of test_minidom.py.  After the tests, we better delete that
StringIO object to avoid wasting memory.  We also reset the _debug
flag.  (Note that this is an undetectable memory leak, and the memory
doesn't get collected by the cycle-gc either, because it's all
reachable -- it's just useless.)
2000-09-21 20:10:39 +00:00
Tim Peters 38fd5b6413 Derived from Martin's SF patch 110609: support unbounded ints in %d,i,u,x,X,o formats.
Note a curious extension to the std C rules:  x, X and o formatting can never produce
a sign character in C, so the '+' and ' ' flags are meaningless for them.  But
unbounded ints *can* produce a sign character under these conversions (no fixed-
width bitstring is wide enough to hold all negative values in 2's-comp form).  So
these flags become meaningful in Python when formatting a Python long which is too
big to fit in a C long.  This required shuffling around existing code, which hacked
x and X conversions to death when both the '#' and '0' flags were specified:  the
hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or
'+' flags too, since signs were always meaningless before for x and X conversions.
Isomorphic shuffling was required in unicodeobject.c.
Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
2000-09-21 05:43:11 +00:00
Marc-André Lemburg d1ba443206 This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.

The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.

As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.
2000-09-19 21:04:18 +00:00
Tim Peters f5fa0fc640 test_userlist.py:
Added new test for new __contains__ method.
    Extensive editing to get rid of asserts.
2000-09-19 20:31:24 +00:00
Paul Prescod 4c799191a2 Fix test errors. 2000-09-19 19:33:02 +00:00
Martin v. Löwis b96e0e5e65 New test cases for the StringIO module 2000-09-19 16:35:39 +00:00
Martin v. Löwis 89c528b02d Don't print specific Node instances unless running verbosely.
Closes Bug #114775.
2000-09-19 16:22:10 +00:00
Barry Warsaw 7158126673 Fixed the error reporting (raise of TestFailed) for the zip() and
zip(None) tests.  Found by Finn Bock a while ago.
2000-09-19 14:42:09 +00:00
Paul Prescod 69cc7153c6 Test output that goes with updated test_minidom. 2000-09-18 20:44:15 +00:00
Paul Prescod 10d27660c9 Change assertions to confirmations so that optimization doesn't disable
checks.
2000-09-18 19:07:26 +00:00
Fred Drake 57a4e90922 Fix up the cleanup of the temporary DB so it works for BSD DB's
compatibility layer as well as "classic" ndbm.
2000-09-18 17:56:58 +00:00
Tim Peters 077a11dd00 arraymodule: Fix SF bug 113960.
reverse() didn't work at all due to bad arg check.
    Fixed that.
    Added Brad Chapman to ACKS file, as the proud new owner of two
        implicitly copyrighted lines of Python source code <wink>.
    Repaired buffer_info's total lack of arg-checking.
    Replaced memmove by memcpy in reverse() guts, as memmove is
        often slower and the memory areas are guaranteed disjoint.
    Replaced poke-and-hope unchecked decl of tmp buffer size by
        assert-checked larger tmp buffer.
    Got rid of inconsistent spaces before open paren in docstrings.
    Added reverse() sanity tests to test_array.py.
2000-09-16 22:31:29 +00:00
Neil Schemenauer a53cf79275 - add a new test
- document some of the tricky tests (hopefully correctly :)
2000-09-15 22:32:29 +00:00
Jeremy Hylton afde7e24b6 fix bug #110661 (PR#356) -- accept either & or ; as separator for CGI
query string
also some doc string reformatting and use of string methods instead of
    older string.splitfields
2000-09-15 20:06:57 +00:00
Jeremy Hylton be467e5c69 Fix Bug #114293:
Strings are unpickled by calling eval on the string's repr. This
    change makes pickle work like cPickle; it checks if the pickled
    string is safe to eval and raises ValueError if it is not.

test suite modifications:
    Verify that pickle catches a variety of insecure string pickles
    Make test_pickle and test_cpickle use exactly the same test suite
    Add test for pickling recursive object
2000-09-15 15:14:51 +00:00
Jack Jansen 8b7c3c0be7 For current directory use os.curdir, not ".". 2000-09-15 12:58:08 +00:00
Jack Jansen 00ce51e38e Allow am/pm as well as AM/PM (C9X behaviour). 2000-09-15 12:57:35 +00:00
Jeremy Hylton 7ae51bf82d Remove "," from the list of always_safe characters. It is a reserved
character according to RFC 2396. Add some text to quote doc string
that explains the quoting rules better.

This closes SF Bug #114427.

Add _fast_quote operation that uses a dictionary instead of a list
when the standard set of safe characters is used.
2000-09-14 16:59:07 +00:00
Fred Drake 72e48bd05f Add test cases to make sure we get the right SyntaxError message for
various illegal uses of "continue".
2000-09-08 16:32:34 +00:00
Tim Peters 50699215f8 test_mmap wrote null bytes into its expected-output file; this caused me to
waste an hour tracking down an illusion; repaired it; writing/reading non-
printable characters (except \t\r\n) into/outof text-mode files ain't
defined x-platform, and at least some Windows text editors do surprising
things in their presence.
Also added a by-hand "build humber" to the Windows build, in an approximation
of Python's inexplicable BUILD-number Unix scheme.  I'll try to remember to
increment it each time I make a Windows installer available.  It's starting
at 2, cuz I've put 2 installers out so far (both with BUILD #0).
2000-09-04 07:34:06 +00:00
Fredrik Lundh 03dd010b4f updated SRE test suite (fixes PEP223 problem, shows syntax errors) 2000-09-03 10:43:16 +00:00
Tim Peters acee48628d Repair failing test_sre.py.
This was a funny one!  The test very subtly relied on 1.5.2's
behavior of treating "\x%" as "\x%", i.e. ignoring that was an
\x escape that didn't make sense.  But /F implemented PEP 223,
which causes 2.0 to raise an exception on the bad escape.
Fixed by merely making the 3 such strings of this kind into
raw strings.
2000-09-03 08:15:19 +00:00
Fredrik Lundh 510c97ba2f return -1 for undefined groups (as implemented in 1.5.2) instead of
None (as documented) from start/end/span.  closes bug #113254
2000-09-02 16:36:57 +00:00
Fredrik Lundh 143328ba63 -- tightened up parsing of octal numbers
-- improved the SRE test harness: don't use asserts, test a few more
   things (including more boundary conditions)
2000-09-02 11:03:34 +00:00
Tim Peters 3620857d60 The "more" cmd varies across Windows flavors, sometimes adding stray
newlines at the start or end.  Fiddle test_popen2 and popen2._test() to
tolerate this.  Also change all "assert"s in these tests to raise
explicit exceptions, so that python -O doesn't render them useless.
Also, in case of error, make the msg display the reprs of what we
wrote and what we read, so we can tell exactly why it's failing.
2000-09-01 20:38:55 +00:00
Barry Warsaw 3a9d0611fb Applying patch #100994 to allow JPython to use more of the standard
Python test suite.  Specifically,

- import time instead of strop in test_b1

- test for ClassType of exceptions using isinstance instead of
  equality in test_exceptions

- remove __builtins__ from dir() output in test_pkg

test_pkg output needs to be regenerated.
2000-09-01 06:53:52 +00:00
Fredrik Lundh 0c4fdbaee8 closes bug #112468 (and all the other bugs that surfaced when
I fixed the a bug in the regression test harness...)
2000-08-31 22:57:55 +00:00
Fred Drake 762c1cb3e3 Test case to exercise fix for error propogation bug in dictionarys. 2000-08-31 19:48:52 +00:00
Jeremy Hylton 6102e29df2 fixes bug #111951
applies patch #101369 by Moshe Zadke
use explicit list of always safe characters instead of string.letters
add test case
2000-08-31 15:48:10 +00:00
Barry Warsaw 64dab4602e Expand the test suite to test both the GNU gettext and translation
class-based APIs.
2000-08-30 03:32:07 +00:00
Andrew M. Kuchling d50a1877ee Fix for two problems on FreeBSD:
In test_poll1(), unregister file descriptors as they're closed,
    and also close the read end of the pipe
In test_poll2(), make the code assume less about the combinations of flag
    bits that will be returned
2000-08-29 16:53:34 +00:00