Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recursion xfail test #15

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from types import MappingProxyType
from collections import OrderedDict

Expand Down Expand Up @@ -139,3 +141,18 @@ def test_unground_lvars():
assert not isground(
ctor((a_lv, sub_ctor((b_lv, 2)), 3)), {a_lv: b_lv, b_lv: var("c")}
)


@pytest.mark.xfail(strict=True)
def test_recursion_limit():
import sys

m = {}
first_lvar = var()
lvar = first_lvar
for i in range(sys.getrecursionlimit()):
m[lvar] = (var(),)
lvar = m[lvar][0]
m[lvar] = 1

reify(first_lvar, m)