#!/bin/sh

set -exv

dh_testdir

[ -d test ] || mkdir test
md5sum kgb > test/sum

[ ! -f test/test.kgb ] || rm -f test/test.kgb

./kgb test/test.kgb test/sum
mv test/sum test/sum.orig
./kgb test/test.kgb
[ "$(cat test/sum)" = "$(cat test/sum.orig)" ]

[ ! -f test/gpl.kgb ] || rm -f test/gpl.kgb
./kgb test/gpl.kgb gpl.txt
[ "$(md5sum test/gpl.kgb)" = "258f3cdf0cf69827c888d25948eb4486  test/gpl.kgb" ]
