Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -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."""
Expand Down
Loading