#! /bin/bash

# Program to decompress, cut apart and compare the contents the
# "last" and "fail" lzw files made by test-os8-run.
# Run from the current working directory.

if [ ! -f last.rklz ]; then
    echo "last.rklz not found."
    exit -1
fi

if [ ! -f fail.rklz ]; then
    echo "fail.rklz not found."
    exit -1
fi

lz4 -dq last.rklz last.rk05
lz4 -dq fail.rklz fail.rk05

../../tools/os8xplode --rk fail.rk05 --rk last.rk05

diff -q last.0 fail.0
diff -q last.1 fail.1
