diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
commit | 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e (patch) | |
tree | eea0f44df59aaaf014eb4580f1fad308e31601bf /Lib/test/test_unicodedata.py | |
parent | 8551dd60781f738e5e5ef4e22b6f071d27e20b50 (diff) | |
download | cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.zip cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.gz cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.bz2 |
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
Diffstat (limited to 'Lib/test/test_unicodedata.py')
-rw-r--r-- | Lib/test/test_unicodedata.py | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py index 7e3cf22..db03d35 100644 --- a/Lib/test/test_unicodedata.py +++ b/Lib/test/test_unicodedata.py @@ -5,6 +5,7 @@ (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" +from test_support import verify, verbose import sha encoding = 'utf-8' @@ -87,38 +88,38 @@ print test_unicodedata() # Some additional checks of the API: print 'API:', -assert unicodedata.digit(u'A',None) is None -assert unicodedata.digit(u'9') == 9 -assert unicodedata.digit(u'\u215b',None) is None -assert unicodedata.digit(u'\u2468') == 9 +verify(unicodedata.digit(u'A',None) is None) +verify(unicodedata.digit(u'9') == 9) +verify(unicodedata.digit(u'\u215b',None) is None) +verify(unicodedata.digit(u'\u2468') == 9) -assert unicodedata.numeric(u'A',None) is None -assert unicodedata.numeric(u'9') == 9 -assert unicodedata.numeric(u'\u215b') == 0.125 -assert unicodedata.numeric(u'\u2468') == 9.0 +verify(unicodedata.numeric(u'A',None) is None) +verify(unicodedata.numeric(u'9') == 9) +verify(unicodedata.numeric(u'\u215b') == 0.125) +verify(unicodedata.numeric(u'\u2468') == 9.0) -assert unicodedata.decimal(u'A',None) is None -assert unicodedata.decimal(u'9') == 9 -assert unicodedata.decimal(u'\u215b',None) is None -assert unicodedata.decimal(u'\u2468',None) is None +verify(unicodedata.decimal(u'A',None) is None) +verify(unicodedata.decimal(u'9') == 9) +verify(unicodedata.decimal(u'\u215b',None) is None) +verify(unicodedata.decimal(u'\u2468',None) is None) -assert unicodedata.category(u'\uFFFE') == 'Cn' -assert unicodedata.category(u'a') == 'Ll' -assert unicodedata.category(u'A') == 'Lu' +verify(unicodedata.category(u'\uFFFE') == 'Cn') +verify(unicodedata.category(u'a') == 'Ll') +verify(unicodedata.category(u'A') == 'Lu') -assert unicodedata.bidirectional(u'\uFFFE') == '' -assert unicodedata.bidirectional(u' ') == 'WS' -assert unicodedata.bidirectional(u'A') == 'L' +verify(unicodedata.bidirectional(u'\uFFFE') == '') +verify(unicodedata.bidirectional(u' ') == 'WS') +verify(unicodedata.bidirectional(u'A') == 'L') -assert unicodedata.decomposition(u'\uFFFE') == '' -assert unicodedata.decomposition(u'\u00bc') == '<fraction> 0031 2044 0034' +verify(unicodedata.decomposition(u'\uFFFE') == '') +verify(unicodedata.decomposition(u'\u00bc') == '<fraction> 0031 2044 0034') -assert unicodedata.mirrored(u'\uFFFE') == 0 -assert unicodedata.mirrored(u'a') == 0 -assert unicodedata.mirrored(u'\u2201') == 1 +verify(unicodedata.mirrored(u'\uFFFE') == 0) +verify(unicodedata.mirrored(u'a') == 0) +verify(unicodedata.mirrored(u'\u2201') == 1) -assert unicodedata.combining(u'\uFFFE') == 0 -assert unicodedata.combining(u'a') == 0 -assert unicodedata.combining(u'\u20e1') == 230 +verify(unicodedata.combining(u'\uFFFE') == 0) +verify(unicodedata.combining(u'a') == 0) +verify(unicodedata.combining(u'\u20e1') == 230) print 'ok' |