Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-10-01 12:12:27 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-01 22:43:08 +0300
commite031e9719d21c11102870b8037bdda995dede5e0 (patch)
tree6b9c011250c749edd9a062188ecb92f18aec9519 /t/t0071-sort.sh
parentd536a711699dd369083b83dd98f3df1fdf2b08f0 (diff)
test-mergesort: add test subcommand
Adapt the qsort certification program from "Engineering a Sort Function" by Bentley and McIlroy for testing our linked list sort function. It generates several lists with various distribution patterns and counts the number of operations llist_mergesort() needs to order them. It compares the result to the output of a trusted sort function (qsort(1)) and also checks if the sort is stable. Also add a test script that makes use of the new subcommand. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0071-sort.sh')
-rwxr-xr-xt/t0071-sort.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t0071-sort.sh b/t/t0071-sort.sh
new file mode 100755
index 0000000000..a8ab174879
--- /dev/null
+++ b/t/t0071-sort.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+test_description='verify sort functions'
+
+. ./test-lib.sh
+
+test_expect_success 'llist_mergesort()' '
+ test-tool mergesort test
+'
+
+test_done