Skip to content

Commit

Permalink
updated test_operations with new test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Shriram-Vibhute committed Oct 30, 2024
1 parent 087f335 commit f50f034
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/math_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ def add(a,b):
return a+b

def sub(a,b):
return a-b
return a-b

def mul(a, b):
return a * b
10 changes: 8 additions & 2 deletions tests/test_operation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.math_operations import add,sub
from src.math_operations import add,sub,mul

def test_add():
assert add(2,3)==5
Expand All @@ -8,4 +8,10 @@ def test_sub():
assert sub(5,3)==2
assert sub(4,3)==1
assert sub(3,3)==0
assert sub(2,3)==-1
assert sub(2,3)==-1

def test_mul():
assert mul(1, 0) == 0
assert mul(0, 1) == 0
assert mul(1, 1) == 1
assert mul(100, 100) == 10000

0 comments on commit f50f034

Please sign in to comment.