#!/usr/bin/env bash

counter=1

# Do this forever
while true; do
    # Capture output of the command
    output=$(../build/Assignment5 < ../documentation/a5_sample_input_2.txt)
    # compare against output3.txt, Else print passed
    if [ "$output" != "$(cat output2.txt)" ]; then
        echo "Test 2 failed"
        # show output
        echo "$output"
        exit 1
    fi
    echo "Test 2 passed $counter times"
    counter=$((counter+1))
done