regrtest: fix test to choose if header should be displayed (#3172)

Check "tests" before its value is replaced.
1 file changed