LangProc / langproc-2017-lab

4 stars 8 forks source link

Test 8 passing erroneously (Interpreter) #45

Closed luisi-at closed 7 years ago

luisi-at commented 7 years ago

More of a 'just so that you are aware' issue.

I had to put in some extra cout stuff to trace an error I was getting but in doing so test 8 (fast multiply) passes when it shouldn't as the output is 0. It seems that the script is taking the extra debug information, failing the comparison to the contents of the reference file but giving a pass output anyway:

screen shot 2017-02-20 at 10 19 07
m8pple commented 7 years ago

Hrmm, looks like I was being a bit sloppy with bash conditional checks, and in terms of testing my tester.

I think that instead of:

if [[ "${GOT_OUTPUT}" -ne "${REF_OUTPUT}" ]]; then

I should have been using:

if [[ "${GOT_OUTPUT}" != "${REF_OUTPUT}" ]]; then

So it was correct for the exit code part, but not for the strings, going by: http://unix.stackexchange.com/questions/16109/bash-double-equals-vs-eq

I'll try repro-ing it, and patch if it works.

Thanks for pointing that out.