#!/bin/sh

set -e

if [ -z $AUTOPKGTEST_TMP ]; then
    # The script is invoked from the override_dh_auto_test target.
    PARSER=src/targets/cgi/parser3
    DIR=debian/examples
else
    PARSER=parser3
    DIR=/usr/share/doc/parser3-common/examples
fi

# The exit status of parser3 is always zero.
$PARSER $DIR/index.en.html | grep --quiet "If you see this page"
$PARSER $DIR/index.ru.html | grep --quiet "Если вы видите эту страницу"
