From ee045e2c3e7ffd1d5e16b5dc08c01a5abac395eb Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Mon, 12 Oct 2026 18:10:06 +0800 Subject: [PATCH 1/2] Update test_add.py --- test_add.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_add.py b/test_add.py index 3e51fb5..ee074bd 100644 --- a/test_add.py +++ b/test_add.py @@ -5,3 +5,6 @@ def test_add_positive(): def test_add_zero(): assert add(0, 5) == 5 + +def test_add_with_negative(): + assert add(-1, -2) == -3 From c2dc5eea56cec1c8c22bfec644744c9dc4ad3af0 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Mon, 12 Oct 2026 18:17:25 +0800 Subject: [PATCH 2/2] Update add.py --- add.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add.py b/add.py index d7dd2c4..247da70 100644 --- a/add.py +++ b/add.py @@ -1,3 +1,3 @@ def add(a, b): """返回 a + b。""" - return abs(a) + abs(b) + return a+b