Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_stack_safety(self):
with recursion_limit(100):
cont.sequence([cont.value(v) for v in range(500)]).run(identity)
def f():
a = yield cont.value(2)
b = yield cont.value(2)
return a + b
def test_left_identity_law(self, f, value):
assert (
cont.value(value).and_then(f).run(identity) == f(value
).run(identity)
)
def test_inequality(self, first, second):
assume(first != second)
assert cont.value(first).run(identity) != cont.value(second
).run(identity)
def test_identity_law(self, value):
assert (
cont.value(value).map(identity).run(identity) ==
cont.value(value).run(identity)
)
def test_stack_safety():
for _ in range(500):
yield cont.value(1)
return None
def test_identity_law(self, value):
assert (
cont.value(value).map(identity).run(identity) ==
cont.value(value).run(identity)
)
def test_right_identity_law(self, value):
assert (
cont.value(value).and_then(
cont.value
).run(identity) == cont.value(value).run(identity)
)
def test_equality(self, value):
assert cont.value(value).run(identity) == cont.value(value
).run(identity)