blob: a3e44bc60598d6c188c3343291b631fdabe45659 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
Split tests
===========
This one tests to make sure that unicode / utf8 data is parsed correctly.
>>> import re2
>>> re2.set_fallback_notification(re2.FALLBACK_EXCEPTION)
>>> a = u'\u6211\u5f88\u597d, \u4f60\u5462?'
>>> re2.split(u' ', a) == [u'\u6211\u5f88\u597d,', u'\u4f60\u5462?']
True
>>> re2.split(b' ', a.encode('utf8')) == [
... b'\xe6\x88\x91\xe5\xbe\x88\xe5\xa5\xbd,',
... b'\xe4\xbd\xa0\xe5\x91\xa2?']
True
>>> re2.set_fallback_notification(re2.FALLBACK_QUIETLY)
|