diff --git a/src/calculator.py b/src/calculator.py index 77e1607..570966c 100644 --- a/src/calculator.py +++ b/src/calculator.py @@ -2,3 +2,7 @@ def add(a: float, b: float) -> float: """Add two numbers and return the result.""" return a + b + +def diff(a: float, b: float) -> float: + """Add two numbers and return the result.""" + return a - b diff --git a/tests/test_calculator.py b/tests/test_calculator.py index dabf164..5bd2bb0 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -1,12 +1,16 @@ """Unit tests for the calculator module.""" -from src.calculator import add +from src.calculator import add, diff def test_add_positive_numbers() -> None: """Test adding two positive numbers.""" assert add(2, 3) == 5 +def test_diff_positive_numbers() -> None: + """Test adding two positive numbers.""" + assert diff(3, 1) == 2 + def test_add_negative_numbers() -> None: """Test adding two negative numbers."""