forked from CSC-510-G55/hw1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
import hw2_debugging | ||
""" | ||
This module tests the merge sort algorithm. | ||
""" | ||
|
||
import pytest | ||
import hw2_debugging | ||
|
||
|
||
@pytest.mark.parametrize("input, output", [ | ||
([], []), | ||
]) | ||
def test_merge_sort_empty_list(inp, out): | ||
"""Test the function with Empty Array""" | ||
assert hw2_debugging.merge_sort(inp) == out | ||
|
||
|
||
@pytest.mark.parametrize("input, output", [ | ||
([1], [1]), | ||
]) | ||
def test_merge_sort_single_element(inp, out): | ||
"""Test the function with Single Element Array""" | ||
assert hw2_debugging.merge_sort(inp) == out | ||
|
||
|
||
@pytest.mark.parametrize( | ||
('input','output'), | ||
( | ||
([],[]), | ||
([1],[1]), | ||
([5,4,3,2,1,-5,-4,-3,-2,-1],[-5,-4,-3,-2,-1,1,2,3,4,5]) | ||
) | ||
) | ||
def test_is_prime(input, output): | ||
assert hw2_debugging.merge_sort(input) == output | ||
|
||
@pytest.mark.parametrize("input, output", [ | ||
([5, 4, 3, 2, 1, -5, -4, -3, -2, -1], [-5, -4, -3, -2, -1, 1, 2, 3, 4, 5]), | ||
]) | ||
def test_merge_sort_mixed_elements(inp, out): | ||
"""Test the function with Mixed Input Array""" | ||
assert hw2_debugging.merge_sort(inp) == out |