From 486ddd08b663fedbce25bb0279f5fbb5e23e2eba Mon Sep 17 00:00:00 2001 From: paACode Date: Wed, 11 Mar 2026 11:24:05 +0100 Subject: [PATCH 1/3] triple function yey --- src/calculator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/calculator.py b/src/calculator.py index 77e1607..a75a89f 100644 --- a/src/calculator.py +++ b/src/calculator.py @@ -2,3 +2,11 @@ def add(a: float, b: float) -> float: """Add two numbers and return the result.""" return a + b + +def add(a: float, b: float) -> float: + """Add two numbers and return the result.""" + return a + b + +def add(a: float, b: float) -> float: + """Add two numbers and return the result.""" + return a + b \ No newline at end of file From 45cfd1bd6fe7a0f496f7ffcf6a041b3e16d09c02 Mon Sep 17 00:00:00 2001 From: paACode Date: Wed, 11 Mar 2026 11:27:21 +0100 Subject: [PATCH 2/3] Fix and added diff function --- src/calculator.py | 8 ++------ tests/test_calculator.py | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calculator.py b/src/calculator.py index a75a89f..570966c 100644 --- a/src/calculator.py +++ b/src/calculator.py @@ -3,10 +3,6 @@ def add(a: float, b: float) -> float: """Add two numbers and return the result.""" return a + b -def add(a: float, b: float) -> float: - """Add two numbers and return the result.""" - return a + b - -def add(a: float, b: float) -> float: +def diff(a: float, b: float) -> float: """Add two numbers and return the result.""" - return a + b \ No newline at end of file + return a - b diff --git a/tests/test_calculator.py b/tests/test_calculator.py index dabf164..59e2335 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -7,6 +7,10 @@ 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 add(3, 1) == 2 + def test_add_negative_numbers() -> None: """Test adding two negative numbers.""" From 22de3d5dfe6ffd338d958890d2b72bf6a6751bb6 Mon Sep 17 00:00:00 2001 From: paACode Date: Wed, 11 Mar 2026 11:29:47 +0100 Subject: [PATCH 3/3] fixing big --- tests/test_calculator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_calculator.py b/tests/test_calculator.py index 59e2335..5bd2bb0 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -1,6 +1,6 @@ """Unit tests for the calculator module.""" -from src.calculator import add +from src.calculator import add, diff def test_add_positive_numbers() -> None: @@ -9,7 +9,7 @@ def test_add_positive_numbers() -> None: def test_diff_positive_numbers() -> None: """Test adding two positive numbers.""" - assert add(3, 1) == 2 + assert diff(3, 1) == 2 def test_add_negative_numbers() -> None: