#!/bin/sh

INPUT="$1"
EXPECTED_OUTPUT="$2"
MAXIMA_OUTPUT=$(echo "$INPUT" | "@MAXIMA@" --quiet --init-lisp="@CMAKE_SOURCE_DIR@/src/wxMathML.lisp" | tr "\n" " ")
if echo "$MAXIMA_OUTPUT" |grep "$EXPECTED_OUTPUT"; then
    echo "Success!"
    exit 0
else
    echo "Failure!"
    echo "Maxima's output:"
    echo "$MAXIMA_OUTPUT"
    echo "Regex for expected output:"
    echo "$EXPECTED_OUTPUT"
    exit 1
fi
