#!/bin/sh
# Check that libdoc can document a standard library in each output format
# and that its console commands work
set -eu

cd "$AUTOPKGTEST_TMP"

libdoc BuiltIn BuiltIn.html
test -s BuiltIn.html
grep -q "BuiltIn" BuiltIn.html

libdoc BuiltIn BuiltIn.libspec
test -s BuiltIn.libspec

libdoc --format JSON BuiltIn BuiltIn.json
python3 -c "import json, sys; json.load(open('BuiltIn.json'))"

libdoc BuiltIn list | grep -q "Should Be Equal"
libdoc BuiltIn version

echo "libdoc test passed"
