test: only inspect on failure
The inspection was done in all cases so far and that's not necessary. Therefore this changed this behavior to only inspect the input on failure cases.
I pulled this out from #25278.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines