#!/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 LICENSE
[ "$(md5sum test/gpl.kgb)" = "86369edb8ca943089b5691f1e4ddfd81  test/gpl.kgb" ]
