Skip to content

Commit

Permalink
Add test for identity mul and associativity mul
Browse files Browse the repository at this point in the history
  • Loading branch information
dantp-ai committed Mar 1, 2024
1 parent 4790f0c commit 223e1c5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,17 @@ def test_distribute(x: float, y: float, z: float) -> None:


@pytest.mark.task0_2
def test_other() -> None:
@given(small_floats, small_floats, small_floats)
def test_other(a: float, b: float, c: float) -> None:
"""
Write a test that ensures some other property holds for your functions.
"""
# TODO: Implement for Task 0.2.
raise NotImplementedError("Need to implement for Task 0.2")
# Identity property multiplication
assert mul(1, a) == a
assert mul(a, 1) == a

# Associative property multiplication
assert_close(mul(a, mul(b, c)), mul(mul(a, b), c))


# ## Task 0.3 - Higher-order functions
Expand Down

0 comments on commit 223e1c5

Please sign in to comment.