def test_list_mult_speed(): config = DraconicConfig(max_loops=10000, max_const_len=10000) i = DraconicInterpreter(config=config) expr = """ while True: a = [0] * 10000 """.strip() with pytest.raises(TooManyStatements): i.execute(expr)
def i(): config = DraconicConfig() inter = DraconicInterpreter(config=config) inter.out__ = [] def foo(v): inter.out__.append(v) inter.builtins['print'] = foo inter.builtins['range'] = range return inter
def i(): # 1000-size iterables, don't limit us by loops, signed 32b int limit config = DraconicConfig(max_loops=99999999, max_const_len=1000, max_int_size=32) return DraconicInterpreter(config=config)