diff options
author | Michael W. Hudson <mwh@python.net> | 2002-05-20 14:22:28 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-05-20 14:22:28 (GMT) |
commit | 7c6a4ad78fc2770abdf3c5dc56a459d9a8636086 (patch) | |
tree | 81b166457fb8c0becea80398b0c5ee01babda9bb /Lib/test | |
parent | 286225b548c6bec4e64125faabaf3e685a8797c6 (diff) | |
download | cpython-7c6a4ad78fc2770abdf3c5dc56a459d9a8636086.zip cpython-7c6a4ad78fc2770abdf3c5dc56a459d9a8636086.tar.gz cpython-7c6a4ad78fc2770abdf3c5dc56a459d9a8636086.tar.bz2 |
More mindless --disable-unicode proofing.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_bool.py | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index f5c91d5..4a8bef1 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -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) |