Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(121807)

Side by Side Diff: Lib/test/test_unicodedata.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_traceback.py ('k') | Lib/test/test_urllib2net.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ Test script for the unicodedata module. 1 """ Test script for the unicodedata module.
2 2
3 Written by Marc-Andre Lemburg (mal@lemburg.com). 3 Written by Marc-Andre Lemburg (mal@lemburg.com).
4 4
5 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 5 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
6 6
7 """ 7 """
8 8
9 import sys 9 import sys
10 import unittest 10 import unittest
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 self.assertEqual(eaw('\x1e'), 'N') 217 self.assertEqual(eaw('\x1e'), 'N')
218 self.assertEqual(eaw('\x20'), 'Na') 218 self.assertEqual(eaw('\x20'), 'Na')
219 self.assertEqual(eaw('\uC894'), 'W') 219 self.assertEqual(eaw('\uC894'), 'W')
220 self.assertEqual(eaw('\uFF66'), 'H') 220 self.assertEqual(eaw('\uFF66'), 'H')
221 self.assertEqual(eaw('\uFF1F'), 'F') 221 self.assertEqual(eaw('\uFF1F'), 'F')
222 self.assertEqual(eaw('\u2010'), 'A') 222 self.assertEqual(eaw('\u2010'), 'A')
223 self.assertEqual(eaw('\U00020000'), 'W') 223 self.assertEqual(eaw('\U00020000'), 'W')
224 224
225 class UnicodeMiscTest(UnicodeDatabaseTest): 225 class UnicodeMiscTest(UnicodeDatabaseTest):
226 226
227 @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess .Popen()")
227 def test_failed_import_during_compiling(self): 228 def test_failed_import_during_compiling(self):
228 # Issue 4367 229 # Issue 4367
229 # Decoding \N escapes requires the unicodedata module. If it can't be 230 # Decoding \N escapes requires the unicodedata module. If it can't be
230 # imported, we shouldn't segfault. 231 # imported, we shouldn't segfault.
231 232
232 # This program should raise a SyntaxError in the eval. 233 # This program should raise a SyntaxError in the eval.
233 code = "import sys;" \ 234 code = "import sys;" \
234 "sys.modules['unicodedata'] = None;" \ 235 "sys.modules['unicodedata'] = None;" \
235 """eval("'\\\\N{SOFT HYPHEN}'")""" 236 """eval("'\\\\N{SOFT HYPHEN}'")"""
236 # We use a separate process because the unicodedata module may already 237 # We use a separate process because the unicodedata module may already
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85, 304 if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85,
304 0x1c, 0x1d, 0x1e, 0x2028, 0x2029): 305 0x1c, 0x1d, 0x1e, 0x2028, 0x2029):
305 self.assertEqual(len(lines), 2, 306 self.assertEqual(len(lines), 2,
306 r"\u%.4x should be a linebreak" % i) 307 r"\u%.4x should be a linebreak" % i)
307 else: 308 else:
308 self.assertEqual(len(lines), 1, 309 self.assertEqual(len(lines), 1,
309 r"\u%.4x should not be a linebreak" % i) 310 r"\u%.4x should not be a linebreak" % i)
310 311
311 if __name__ == "__main__": 312 if __name__ == "__main__":
312 unittest.main() 313 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_traceback.py ('k') | Lib/test/test_urllib2net.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+