2dd88e503db79c9fe2c68a24cc77b062ec60705c
   1#!/bin/sh
   2
   3test_description='Deltification regression test'
   4
   5../test-delta 2>/dev/null
   6test $? == 127 && {
   7        echo "* Skipping test-delta regression test."
   8        exit 0
   9}
  10
  11. ./test-lib.sh
  12
  13>empty
  14echo small >small
  15echo smallish >smallish
  16cat ../../COPYING >large
  17sed -e 's/GNU/G.N.U/g' large >largish
  18
  19test_expect_success 'No regression in deltify code' \
  20'
  21fail=0
  22for src in empty small smallish large largish
  23do
  24    for dst in empty small smallish large largish
  25    do
  26        if  test-delta -d $src $dst delta-$src-$dst &&
  27            test-delta -p $src delta-$src-$dst out-$src-$dst &&
  28            cmp $dst out-$src-$dst
  29        then
  30            echo "* OK ($src->$dst deitify and apply)"
  31        else
  32            echo "* FAIL ($src->$dst deitify and apply)"
  33            fail=1
  34        fi
  35    done
  36done
  37case "$fail" in
  380) (exit 0) ;;
  39*) (exit $fail) ;;
  40esac
  41'
  42
  43test_done