Add tests for ucd::isspace.

This commit is contained in:
Reece H. Dunn
2012-12-24 15:26:36 +00:00
parent cc9abdff12
commit 3f9f6c0623
3 changed files with 16 additions and 4 deletions
+7 -2
View File
@@ -27,6 +27,11 @@ unicode_chars = {}
for data in ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData'):
for codepoint in data['CodePoint']:
unicode_chars[codepoint] = data
unicode_chars[codepoint]['Properties'] = []
for data in ucd.parse_ucd_data(ucd_rootdir, 'PropList'):
if data['Property'] in ['White_Space']:
for codepoint in data['Range']:
unicode_chars[codepoint]['Properties'].append(data['Property'])
null = ucd.CodePoint('0000')
if __name__ == '__main__':
@@ -39,6 +44,6 @@ if __name__ == '__main__':
if title == null: title = codepoint
if upper == null: upper = codepoint
if lower == null: lower = codepoint
print '%s %s %s %s %s' % (codepoint, data['GeneralCategory'], upper, lower, title)
print '%s %s %s %s %s %s' % (codepoint, data['GeneralCategory'], upper, lower, title, ' '.join(data['Properties']))
except KeyError:
print '%s Cn %s %s %s' % (codepoint, codepoint, codepoint, codepoint)
print '%s Cn %s %s %s ' % (codepoint, codepoint, codepoint, codepoint)