Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
diff tests/farray-array.t @ 782:11f3101c1980
farray.sh: Implemented plain Insertionsort.
Using the optimized algorithm already used in Shell sort, just without manx
gaps and using only the fixed last step 1.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 26 Oct 2024 18:35:37 +0200 |
| parents | 0bb535e50271 |
| children | b5b19c62da24 |
line wrap: on
line diff
--- a/tests/farray-array.t Sat Oct 26 14:09:47 2024 +0200 +++ b/tests/farray-array.t Sat Oct 26 18:35:37 2024 +0200 @@ -1397,6 +1397,19 @@ $ check_no_array_artifacts $ farray_create TEST 5 3 2 4 + $ farray_insertionsort TEST + $ check_array_is_sorted "$TEST" + $ farray_debug TEST + DEBUG: array `TEST' has length 4 + DEBUG: the items: + DEBUG: 1: `2' + DEBUG: 2: `3' + DEBUG: 3: `4' + DEBUG: 4: `5' + $ farray_release TEST + $ check_no_array_artifacts + + $ farray_create TEST 5 3 2 4 $ farray_heapsort TEST $ check_array_is_sorted "$TEST" $ farray_debug TEST @@ -1438,6 +1451,14 @@ $ farray_splice "" TEST 1 "" UNSORTED $ check_array_is_sorted "$TEST" [1] + $ farray_insertionsort TEST + $ check_array_is_sorted "$TEST" + $ farray_release TEST + + $ farray_create TEST + $ farray_splice "" TEST 1 "" UNSORTED + $ check_array_is_sorted "$TEST" + [1] $ farray_shellsort TEST $ check_array_is_sorted "$TEST" $ farray_release TEST @@ -1945,5 +1966,3 @@ ========= $ check_no_local_artifacts - - $ set
