35 lines
665 B
Bash
Executable File
35 lines
665 B
Bash
Executable File
#!/bin/bash
|
|
|
|
correct=true
|
|
|
|
program1_out=$(./program)
|
|
solution1_out=$(./solution)
|
|
|
|
if [ "$program1_out" == "$solution1_out" ]
|
|
then
|
|
echo "PASS " $program1_out " equals " $solution1_out
|
|
else
|
|
echo "FAIL " $program1_out " DOES NOT EQUAL " $solution1_out
|
|
correct = false
|
|
fi
|
|
|
|
program_out=$(./program This should be in reverse order)
|
|
solution_out=$(./solution This should be in reverse order)
|
|
|
|
if [ "$program_out" == "$solution_out" ]
|
|
then
|
|
echo "PASS " $program_out " equals " $solution_out
|
|
else
|
|
echo "FAIL " $program_out " DOES NOT EQUAL " $solution_out
|
|
correct = false
|
|
fi
|
|
|
|
if [ "$correct" = true ]
|
|
then
|
|
echo "PASS";
|
|
else
|
|
echo "FAIL";
|
|
fi
|
|
|
|
|