Commit 77b84b6f authored by Kevin Modzelewski's avatar Kevin Modzelewski

This test should be working now

parent 424539a1
# skip-if: True
# This test works but 1) is very slow [the importing is, not the regex itself], and 2) throws warnings
# This test also seems to leak a lot of memory.
import sre_compile import sre_compile
import sre_constants
r = sre_compile.compile("a(b+)c", 0) r = sre_compile.compile("a(b+)c", 0)
print r.match("") print r.match("")
print r.match("ac") print r.match("ac")
print r.match("abc").groups() print r.match("abc").groups()
for i in xrange(100000): for i in xrange(100000):
r.match("abbc").groups() r.match("abbc").groups()
if i % 1000 == 0: if i % 10000 == 0:
print i print i
def identity(o):
return o
charset = [(sre_constants.RANGE, (128, 65535))]
print sre_compile._optimize_charset(charset, identity)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment