#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p sqlite koka
#! nix-shell -I https://github.com/NixOS/nixpkgs/archive/e764fc9a405871f1f6ca3d1394fb422e0a0c3951.tar.gz

set -e

koka -e --ccincdir=./sqlite test/test.kk

RESULT=$(sqlite3 koka-test.sqlite3 'SELECT * FROM koka')
if [[ "$RESULT" != "value inserted from koka" ]]; then
    echo "FAIL"
    echo "want: value inserted from koka"
    echo " got: $RESULT"
else
    echo "PASS"
fi
