diff --git a/rusty_results/tests/exceptions/__init__.py b/rusty_results/tests/exceptions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/rusty_results/tests/exceptions/test_early_return.py b/rusty_results/tests/exceptions/test_early_return.py new file mode 100644 index 0000000..62e6ebb --- /dev/null +++ b/rusty_results/tests/exceptions/test_early_return.py @@ -0,0 +1,11 @@ +from rusty_results import early_return, Option, Some, Empty + + +def test_early_return(): + @early_return + def __test_it() -> Option[str]: + foo: Option = Empty() + _ = ~foo + return Some(10) + + assert __test_it() == Empty()