From 8b42d4357462718c0531009f65562677b1628cf7 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Tue, 20 May 2025 17:27:14 -0300 Subject: [PATCH] Added few edge cases to the test suite --- tests/test_goulagsort.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_goulagsort.py b/tests/test_goulagsort.py index 2d55c71..a000d3e 100644 --- a/tests/test_goulagsort.py +++ b/tests/test_goulagsort.py @@ -57,6 +57,17 @@ def test_duplicated_sort(): assert send_to_goulag(inputlist) == expectedList +def test_list_with_zero_and_negatives(): + inputlist = [0,50,-5,2,-10,7,15] + expectedList = sorted(copy.deepcopy(inputlist)) + + assert send_to_goulag(inputlist) == expectedList + +def test_many_duplicates(): + input_list = [7, 2, 7, 7, 1, 7, 3, 7] + expected_list = sorted(input_list[:]) + assert send_to_goulag(input_list[:]) == expected_list + def test_really_long_sort(): inputList = [random.randint(1,500000) for _ in range(10000)] expectedList = sorted(copy.deepcopy(inputList))