Skip to content

Commit

Permalink
add tests for check
Browse files Browse the repository at this point in the history
  • Loading branch information
mishankov committed Feb 8, 2024
1 parent ef2decb commit 778a79c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_tipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ def add(a: int, b: int) -> int:

assert Pipe(1).pipe(add, 2).unwrap() == 3
assert Pipe(2).pipe(range, 4).pipe(len).unwrap() == 2


def test_check_run(capsys):
assert Pipe(1).check(print).unwrap() == 1

captured = capsys.readouterr()
assert captured.out == "1\n"


def test_check_immutability():
assert Pipe(1).check(lambda x: x + 1).unwrap() == 1

0 comments on commit 778a79c

Please sign in to comment.