summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_b1.py
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #523169, by Samuele Pedroni.Guido van Rossum2002-02-261-0/+10
| | | | | | There were never tests for the fact that list() always returns a *new* list object, even when the argument is a list, while tuple() may return a reference to the argument when it is a tuple. Now there are.
* SF Patch #494874 add tests for int()/long() invalid parametersNeal Norwitz2001-12-291-0/+23
|
* Ensure that complex() only accepts a string argument as the first arg,Fred Drake2001-12-131-0/+8
| | | | | and only if there is no second arg. This closes SF patch #479551.
* Additional coverage tests by Neil Norwitz.Guido van Rossum2001-12-111-0/+12
| | | | (SF patch #491418, #491420, #491421.)
* The first batch of changes recommended by the fixdiv tool. These areGuido van Rossum2001-09-041-1/+1
| | | | | mostly changes of / operators into //. Once or twice I did more or less than recommended.
* Use raw-unicode-escape for the tests that require it.Martin v. Löwis2001-08-171-2/+2
|
* Patch #445762: Support --disable-unicodeMartin v. Löwis2001-08-171-37/+55
| | | | | | | | - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
* Add tests for getattr() and hasattr() with non-string argsJeremy Hylton2001-07-301-0/+18
|
* SF bug #444510: int() should guarantee truncation.Tim Peters2001-07-261-0/+13
| | | | It's guaranteed now, assuming the platform modf() works correctly.
* 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.
* OK, changed my mind once more on this. The comparison hierarchy isGuido van Rossum2001-01-221-1/+1
| | | | | | | | | | | | | | now None < all numeric types < all other types so that once again map(max, Squares(3), Squares(2)) equals [0, 1, 4]
* Numeric-smelling objects now once again compare smaller thanGuido van Rossum2001-01-221-1/+1
| | | | non-numeric ones, so 4 < None again in the 'map' test.
* Add test that ensures hash([]) and hash({}) raise TypeError.Guido van Rossum2001-01-181-0/+6
|
* When a PyCFunction that takes only positional parameters is called withFred Drake2001-01-041-0/+11
| | | | | | | | | | an empty keywords dictionary (via apply() or the extended call syntax), the keywords dict should be ignored. If the keywords dict is not empty, TypeError should be raised. (Between the restructuring of the call machinery and this patch, an empty dict in this situation would trigger a SystemError via PyErr_BadInternalCall().) Added regression tests to detect errors for this.
* Numbers no longer compare smaller than all other types. Fix the onlyNeil Schemenauer2001-01-041-1/+2
| | | | part of the testsuite that breaks. The old behavior may be restored.
* Actually call the object with an __call__ method, instead of justJeremy Hylton2001-01-031-0/+1
| | | | | checking if it is callable. This is the only place in the test suite where an __call__ method is called.
* Update the code to better reflect recommended style:Fred Drake2000-12-121-127/+127
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* This patch adds a new Python C API called PyString_AsStringAndSize()Marc-André Lemburg2000-09-191-0/+12
| | | | | | | | | | | | | 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.
* Applying patch #100994 to allow JPython to use more of the standardBarry Warsaw2000-09-011-1/+1
| | | | | | | | | | | | | 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.
* style nitsJeremy Hylton2000-08-231-4/+8
|
* Break the cycles after testing cmp() on cyclic objects.Vladimir Marangozov2000-07-141-0/+2
|
* typos fixed by Rob HooftJeremy Hylton2000-06-281-1/+1
|
* Fix PR#7 comparisons of recursive objectsJeremy Hylton2000-04-141-0/+9
| | | | | Note that comparisons of deeply nested objects can still dump core in extreme cases.
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-051-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Add tests for float() and complex() with string args (Nick/StephanieGuido van Rossum1999-03-251-0/+2
| | | | Lockwood).
* Added a new test for old filter() memory leakBarry Warsaw1999-01-281-0/+17
|
* Nannified, and re-indented with 4 spaces.Guido van Rossum1998-08-101-88/+88
|
* Improved test set for int() and long() string conversions.Guido van Rossum1998-06-301-0/+59
|
* With the recent change that makes numbers compare smaller than anything,Guido van Rossum1998-06-111-3/+3
| | | | the outcome of the test for max has changed.
* Added tests of the new builtin functions issubclass() and isinstance()Barry Warsaw1997-08-221-0/+36
|
* Fix hex tests for 64-bit machines.Guido van Rossum1997-05-141-1/+3
|
* Added test of complex() (that catches a bug in 1.4!).Guido van Rossum1997-03-311-0/+39
| | | | | Added test that ensures that int() and long() truncate float numbers towards zero.
* updated the hex(-16) test since hex() of a signed literal has changed.Barry Warsaw1997-01-131-1/+1
|
* avoid math, don't abort when overflow check failsGuido van Rossum1995-03-041-1/+5
|
* * Lib/test/test_b1.py: test eval() and execfile() with globals,Guido van Rossum1995-01-021-0/+13
| | | | locals arguments
* Test new __import__ module, test reload of built-in module, testGuido van Rossum1994-12-301-0/+8
| | | | has_key() on empty dictionary
* more complete tests of built-in functionsGuido van Rossum1994-11-101-0/+44
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-0/+24
|
* * test_*.py: new lambda syntax (also affects tests for filter, map,Guido van Rossum1993-11-301-13/+8
| | | | | | | | | | reduce) * ftplib.py: added default callback for retrlines; added dir() method * ftplib.py: don't return self in self.connect(); added hack so that if 'CDUP' is not understood, 'CWD ..' is tried. * ftplib.py: second method called init() should have been called connect(); if __init__ sees more than one argument, it will also try to login().
* * string.py: added rindex(), rfind(); changed index() to interpretGuido van Rossum1993-11-081-0/+39
| | | | | | | | | | | negative start indices starting from the right. * ftplib.py: debug() -> set_debuglevel(); change demo to use __init__(). * os.py: added execl, execlp, and execvp. * lambda.py: removed (now that we have built-in map, reduce, bagof, lambda) * test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce * commands.py: use os, not posix * test_grammar.py: make it easy to disable non-portable int overflow tests * dis.py: don't abuse range()
* added builtin b/w compat module.Guido van Rossum1993-10-221-9/+1
| | | | changed testing of exec.
* * os.py: _exit doesn't exist in all variations of posixGuido van Rossum1993-01-261-6/+10
| | | | * Added fcmp() to test_support.py and use it in test*.py
* Added some new tests and two new files for testing: test_types.pyGuido van Rossum1992-11-271-0/+23
| | | | | (testing operations on built-in types) and autotest.py (automatic regression testing).
* Initial revisionGuido van Rossum1992-01-271-0/+127