t / t0009-prio-queue.shon commit t3306: abstract away SHA-1-specific constants (b99bfc7)
   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' '
  20        test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
  21        test_cmp expect actual
  22'
  23
  24cat >expect <<'EOF'
  252
  263
  274
  281
  295
  306
  31EOF
  32test_expect_success 'mixed put and get' '
  33        test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
  34        test_cmp expect actual
  35'
  36
  37cat >expect <<'EOF'
  381
  392
  40NULL
  411
  422
  43NULL
  44EOF
  45test_expect_success 'notice empty queue' '
  46        test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
  47        test_cmp expect actual
  48'
  49
  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
  64test_done