interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / perf / p0071-sort.sh

52 lines · 910 bytes Raw Blame History
1#!/bin/sh
2
3test_description='Basic sort performance tests'
4. ./perf-lib.sh
5
6test_perf_default_repo
7
8test_expect_success 'setup' '
9 git ls-files --stage "*.[ch]" "*.sh" |
10 cut -f2 -d" " |
11 git cat-file --batch >unsorted
12'
13
14test_perf 'sort(1) unsorted' '
15 sort <unsorted >sorted
16'
17
18test_expect_success 'reverse' '
19 sort -r <unsorted >reversed
20'
21
22for file in sorted reversed
23do
24 test_perf "sort(1) $file" "
25 sort <$file >actual
26 "
27done
28
29for file in unsorted sorted reversed
30do
31
32 test_perf "string_list_sort() $file" "
33 test-tool string-list sort <$file >actual
34 "
35
36 test_expect_success "string_list_sort() $file sorts like sort(1)" "
37 test_cmp_bin sorted actual
38 "
39done
40
41for file in unsorted sorted reversed
42do
43 test_perf "DEFINE_LIST_SORT $file" "
44 test-tool mergesort sort <$file >actual
45 "
46
47 test_expect_success "DEFINE_LIST_SORT $file sorts like sort(1)" "
48 test_cmp_bin sorted actual
49 "
50done
51
52test_done