Skip to content

Commit 330c97c

Browse files
committed
add a test that ensures we can return effects from @Do functions
1 parent fbfb6d6 commit 330c97c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

effect/test_do.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ def f():
3636
assert perf(f()) == "hello"
3737

3838

39+
def test_do_return_effect():
40+
@do
41+
def f():
42+
yield do_return(Effect(Constant("hello")))
43+
assert perf(f()) == "hello"
44+
45+
3946
def test_yield_effect():
4047
"""Yielding an effect in @do results in the Effect's result."""
4148
@do

0 commit comments

Comments
 (0)