#!/usr/bin/env bash
# This script tests whether textEnhance can handle
# various kinds of input gracefully (the filenames
# of the example inputs should be self-explanatory)

repo_dir=$HOME/MAUS/TOOL/textEnhance

function test_files {
    for file in $1/*; do
        echo "Converting $file"
        ../textEnhance "$file" -o /dev/null
        echo "Finished with exit code $?"
        echo  # empty line for visual separation
    done
    echo; echo '---'; echo  # once again, visual separation
}

cd $repo_dir/testfiles

echo "The following files should result in a warning, but no errors:"
test_files convertible-with-warning

echo "The following files should result in an error:"
test_files not-convertible

echo "The following files have unusual names, but should not result in any errors or warnings:"
test_files weird-filenames
