#!/bin/sh
set -e

# Upstream ships no test suite of its own. Check that the entry point is
# present and syntactically valid, and that the Debian delta is in place.
# Loading the script itself is left to the installed system, where
# @marijn/buildtool and @babel/* exist.
test -f bin/pm-buildhelper.js
node --check bin/pm-buildhelper.js

node -e '
const pkg = require("./package.json")
if (pkg.bin["pm-buildhelper"] != "bin/pm-buildhelper.js") process.exit(1)
if (pkg.bin["pm-runtests"]) process.exit(1)
if (pkg.dependencies["@marijn/testtool"]) process.exit(1)
'
