Skip to content

Commit

Permalink
Add tests for felis.bool.both
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeeeT committed Jun 11, 2024
1 parent 52ab260 commit b79e330
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Empty file added tests/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions tests/test_bool.py
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`")

0 comments on commit b79e330

Please sign in to comment.