예제 #1
0
    def test_SelectionSort(self):
        """! Testing of selection sort method """
        tst6 = [1, 2, 3, 7, 5, 6, 4]
        true_tst6 = [1, 2, 3, 4, 5, 6, 7]
        self.assertEqual(true_tst6, Sort.SelectionSort(tst6))

        tst7 = [-1, -2, -3, -7, -5, -6, -4]
        true_tst7 = [-7, -6, -5, -4, -3, -2, -1]
        self.assertEqual(true_tst7, Sort.SelectionSort(tst7))

        tst8 = [10, -2, 3, -7, 5, 6, -4]
        true_tst8 = [-7, -4, -2, 3, 5, 6, 10]
        self.assertEqual(true_tst8, Sort.SelectionSort(tst8))

        tst9 = [5.0, 4.0, 3.0, 2.0, 1.0]
        true_tst9 = [1.0, 2.0, 3.0, 4.0, 5.0]
        self.assertEqual(true_tst9, Sort.SelectionSort(tst9))

        tst10 = []
        true_tst10 = []
        self.assertEqual(true_tst10, Sort.SelectionSort(tst10))