codersforcauses / codersforcauses/software-engineering-practices-demo-2024-winter
Create a test for the subtraction operation
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Task**
Create a test for the subtraction operation. this can be seen at ```tests/test_operations.py``` with the function ```test_subtraction```.
**Acceptance Criteria**
- the test should fail if ```subtraction``` is mathematically wrong
- the test should succeed if ```subtraction``` is mathematically correct
**Answer**
Note: It is not expected that you know how to write tests, your goal is to understand what the below code does and perform the change on your branch that you have created and create a pull request
```
def test_subtraction():
"""
GIVEN: Two numbers
WHEN: passed in to the function subtraction
THEN: the resulting is the subtraction of the two numbers
"""
assert subtraction(7, 3) == 4
assert subtraction(0, 0) == 0
assert subtraction(2, 5) == -3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.