-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
from felis.bool import No, Yes, both | ||
|
||
|
||
def test_both_returns_no_when_first_is_no(): | ||
match both(Yes())(No()): | ||
case No(): | ||
pass | ||
case Yes(): | ||
pytest.fail("`both` should return `No` when the first argument is `No`") | ||
|
||
|
||
def test_both_returns_no_when_second_is_no(): | ||
match both(No())(Yes()): | ||
case No(): | ||
pass | ||
case Yes(): | ||
pytest.fail("`both` should return `No` when the second argument is `No`") | ||
|
||
|
||
def test_both_returns_yes_when_both_are_yes(): | ||
match both(Yes())(Yes()): | ||
case Yes(): | ||
pass | ||
case No(): | ||
pytest.fail("`both` should return `Yes` when both arguments are `Yes`") |