]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0009-prio-queue.sh
The sixth batch
[thirdparty/git.git] / t / t0009-prio-queue.sh
CommitLineData
b4b594a3
JH
1#!/bin/sh
2
3test_description='basic tests for priority queue implementation'
4. ./test-lib.sh
5
6cat >expect <<'EOF'
71
82
93
104
115
125
136
147
158
169
1710
18EOF
19test_expect_success 'basic ordering' '
15b75817 20 test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
b4b594a3
JH
21 test_cmp expect actual
22'
23
24cat >expect <<'EOF'
252
263
274
281
295
306
31EOF
32test_expect_success 'mixed put and get' '
15b75817 33 test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
b4b594a3
JH
34 test_cmp expect actual
35'
36
37cat >expect <<'EOF'
381
392
40NULL
411
422
43NULL
44EOF
45test_expect_success 'notice empty queue' '
15b75817 46 test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
b4b594a3
JH
47 test_cmp expect actual
48'
49
aca4240f
DS
50cat >expect <<'EOF'
513
522
536
544
555
561
578
58EOF
59test_expect_success 'stack order' '
60 test-tool prio-queue stack 8 1 5 4 6 2 3 dump >actual &&
61 test_cmp expect actual
62'
63
b4b594a3 64test_done