pypy.module._sre.test.apptest_sre:test_opcode_at_loc_boundary
def test_opcode_at_loc_boundary():
import locale
O, AT, CH, MAXREPEAT = _sre_opcodes()
try:
_void_locale()
opcodes1 = _encode_literal(O, "bla") \
+ [O["at"], AT["at_loc_boundary"], O["success"]]
opcodes2 = _encode_literal(O, "bla") \
+ [O["at"], AT["at_loc_non_boundary"], O["success"]]
assert _opcode_search(opcodes1, "bla\xFC")
_opcode_no_match(opcodes2, "bla\xFC")
oldlocale = locale.setlocale(locale.LC_ALL)
locale.setlocale(locale.LC_ALL, "de_DE")
> _opcode_no_match(opcodes1, "bla\xFC")
../build/pypy/module/_sre/test/apptest_sre.py:780:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
opcodes = [16, 98, 16, 108, 16, 97, ...], strings = ['blaü'], groups = 0
def _opcode_no_match(opcodes, strings, groups=0):
if isinstance(strings, str):
strings = [strings]
for string in strings:
> assert not _opcode_search(opcodes, string, groups)
E AssertionError: assert not <re.Match object; span=(0, 3), match='bla'>
E + where <re.Match object; span=(0, 3), match='bla'> = _opcode_search([16, 98, 16, 108, 16, 97, ...], 'blaü', 0)
../build/pypy/module/_sre/test/apptest_sre.py:681: AssertionError
builder: pypy-c-jit-macos-arm64 build #1389+
test: pypy.module._sre.test.apptest_sre:test_opcode_at_loc_boundary