Skip to content

Commit

Permalink
Seperate Method for Each Test Case
Browse files Browse the repository at this point in the history
  • Loading branch information
balaji305 committed Sep 27, 2024
1 parent 38d269c commit 743e649
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions hw2_debugging_test.py
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

0 comments on commit 743e649

Please sign in to comment.