#!/bin/bash
set -e

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cd "${AUTOPKGTEST_TMP}"
ls
echo "BEGIN"
python3>&1 <<HERE
import math

import natsort
import numpy
import re
from sinfo import sinfo

import sys
sys.stdout = open("testresult", "w")
sinfo(std_lib=True)
sys.stdout.close()
HERE

cat testresult
numlines=3
[ "$(cat testresult | grep 'natsort\|numpy\|re[[:space:]]' | wc -l)" = "$numlines" ] || exit 1
echo "PASS"
