comparison tests/farray-array.t @ 773:bae0652d0577

farray.sh: More tests for sorting: using a random array
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 23 Oct 2024 18:33:38 +0200
parents 03350d2a2af6
children 75a8b69c04f0
comparison
equal deleted inserted replaced
772:e942b091b762 773:bae0652d0577
1383 Sort 1383 Sort
1384 ==== 1384 ====
1385 1385
1386 $ farray_create TEST 5 3 2 4 1386 $ farray_create TEST 5 3 2 4
1387 $ farray_sort TEST 1387 $ farray_sort TEST
1388 $ check_array_is_sorted "$TEST"
1388 $ farray_debug TEST 1389 $ farray_debug TEST
1389 DEBUG: array `TEST' has length 4 1390 DEBUG: array `TEST' has length 4
1390 DEBUG: the items: 1391 DEBUG: the items:
1391 DEBUG: 1: `2' 1392 DEBUG: 1: `2'
1392 DEBUG: 2: `3' 1393 DEBUG: 2: `3'
1393 DEBUG: 3: `4' 1394 DEBUG: 3: `4'
1394 DEBUG: 4: `5' 1395 DEBUG: 4: `5'
1395 $ farray_release TEST 1396 $ farray_release TEST
1397 $ check_no_array_artifacts
1398
1399 $ create_random_array UNSORTED 1000
1400 $ check_array_is_sorted "$UNSORTED"
1401 [1]
1402
1403 $ farray_create TEST
1404 $ farray_splice "" TEST 1 "" UNSORTED
1405 $ farray_gnomesort TEST
1406 $ check_array_is_sorted "$TEST"
1407 $ farray_release TEST
1408
1409 $ farray_release UNSORTED
1396 $ check_no_array_artifacts 1410 $ check_no_array_artifacts
1397 1411
1398 1412
1399 Binary Search 1413 Binary Search
1400 ============= 1414 =============