More mindless --disable-unicode proofing.

This commit is contained in:
Michael W. Hudson 2002-05-20 14:22:28 +00:00
parent 286225b548
commit 7c6a4ad78f
1 changed files with 24 additions and 23 deletions

View File

@ -1,6 +1,6 @@
# Test properties of bool promised by PEP 285
from test_support import verbose, TestFailed, TESTFN, vereq
from test_support import verbose, TestFailed, TESTFN, vereq, have_unicode
import os
def veris(a, b):
@ -176,28 +176,29 @@ veris("xyz".isupper(), False)
veris("xyz".startswith("x"), True)
veris("xyz".startswith("z"), False)
veris(u"xyz".endswith(u"z"), True)
veris(u"xyz".endswith(u"x"), False)
veris(u"xyz0123".isalnum(), True)
veris(u"@#$%".isalnum(), False)
veris(u"xyz".isalpha(), True)
veris(u"@#$%".isalpha(), False)
veris(u"0123".isdecimal(), True)
veris(u"xyz".isdecimal(), False)
veris(u"0123".isdigit(), True)
veris(u"xyz".isdigit(), False)
veris(u"xyz".islower(), True)
veris(u"XYZ".islower(), False)
veris(u"0123".isnumeric(), True)
veris(u"xyz".isnumeric(), False)
veris(u" ".isspace(), True)
veris(u"XYZ".isspace(), False)
veris(u"X".istitle(), True)
veris(u"x".istitle(), False)
veris(u"XYZ".isupper(), True)
veris(u"xyz".isupper(), False)
veris(u"xyz".startswith(u"x"), True)
veris(u"xyz".startswith(u"z"), False)
if have_unicode:
veris(unicode("xyz", 'ascii').endswith(unicode("z", 'ascii')), True)
veris(unicode("xyz", 'ascii').endswith(unicode("x", 'ascii')), False)
veris(unicode("xyz0123", 'ascii').isalnum(), True)
veris(unicode("@#$%", 'ascii').isalnum(), False)
veris(unicode("xyz", 'ascii').isalpha(), True)
veris(unicode("@#$%", 'ascii').isalpha(), False)
veris(unicode("0123", 'ascii').isdecimal(), True)
veris(unicode("xyz", 'ascii').isdecimal(), False)
veris(unicode("0123", 'ascii').isdigit(), True)
veris(unicode("xyz", 'ascii').isdigit(), False)
veris(unicode("xyz", 'ascii').islower(), True)
veris(unicode("XYZ", 'ascii').islower(), False)
veris(unicode("0123", 'ascii').isnumeric(), True)
veris(unicode("xyz", 'ascii').isnumeric(), False)
veris(unicode(" ", 'ascii').isspace(), True)
veris(unicode("XYZ", 'ascii').isspace(), False)
veris(unicode("X", 'ascii').istitle(), True)
veris(unicode("x", 'ascii').istitle(), False)
veris(unicode("XYZ", 'ascii').isupper(), True)
veris(unicode("xyz", 'ascii').isupper(), False)
veris(unicode("xyz", 'ascii').startswith(unicode("x", 'ascii')), True)
veris(unicode("xyz", 'ascii').startswith(unicode("z", 'ascii')), False)
f = file(TESTFN, "w")
veris(f.closed, False)