def test_qsort_when_two(self): arr = list(range(10, 0, -1)) result = qsort.qsort(arr) self.assertEqual(result, list(range(1, 11)))
def test_qsort_when_two(self): arr = [2, 1] two_result = qsort.qsort(arr) self.assertEqual(two_result, [1, 2])
def test_qsort_when_none_then_empty(self): empty_result = qsort.qsort(None) self.assertIsNotNone(empty_result, "None should not return None") self.assertTrue(len(empty_result) == 0)
def test_qsort_when_one_then_one(self): one_result = qsort.qsort([1]) self.assertTrue(len(one_result) == 1) self.assertEqual(one_result[0], 1)
def test_qsort_when_empty_then_empty(self): empty_result = qsort.qsort([]) self.assertIsNotNone(empty_result, "empty array should not return None") self.assertTrue(len(empty_result) == 0)