|
@@ -20,6 +20,23 @@ def test_mergeSort(pruebas):
|
20
|
20
|
for nombre, lista in pruebas.items():
|
21
|
21
|
print(f"{nombre}: Obtained -> {sorting.mergeSort(lista)} | Expected -> {sorted(lista)}")
|
22
|
22
|
|
|
23
|
+def test_heapSort(pruebas):
|
|
24
|
+ FAIL = False
|
|
25
|
+
|
|
26
|
+ print("\nProbando HeapSort")
|
|
27
|
+
|
|
28
|
+ for nombre, lista in pruebas.items():
|
|
29
|
+ if sorting.heapSort(lista) == sorted(lista):
|
|
30
|
+ print(f"{nombre}: " + "Pass")
|
|
31
|
+ else:
|
|
32
|
+ print(f"{nombre}: " + "Fail")
|
|
33
|
+ FAIL = True
|
|
34
|
+
|
|
35
|
+ if FAIL == True and DEBUG_OUTPUT == True:
|
|
36
|
+ print("\n Test FAIL OUTPUT for HeapSort")
|
|
37
|
+ for nombre, lista in pruebas.items():
|
|
38
|
+ print(f"{nombre}: Obtained -> {sorting.heapSort(lista)} | Expected -> {sorted(lista)}")
|
|
39
|
+
|
23
|
40
|
def test_quickSort(pruebas):
|
24
|
41
|
FAIL = False
|
25
|
42
|
|
|
@@ -62,6 +79,7 @@ def main():
|
62
|
79
|
"Ordenada":[1,2,3,4,5,6,7]}
|
63
|
80
|
|
64
|
81
|
test_mergeSort(PRUEBAS)
|
|
82
|
+ test_heapSort(PRUEBAS)
|
65
|
83
|
test_quickSort(PRUEBAS)
|
66
|
84
|
test_shellSort(PRUEBAS)
|
67
|
85
|
|