Closed martica closed 5 years ago
Oh yeah - this is a big one. We're very much relying on "well written tests" to catch this edge case, which is a definite footgun.
The variant on this theme is "a test function that outputs nothing" - even if the behavior is completely different, the test will pass because there's no output, and no output == no output on both sides.
I'm most of the way through correcting tests that don't catch their exceptions. Most are okay after adding the try, but there are some that have been hiding broken behaviour. A bunch in the tests of the time module. It wasn't importing time in most of the tests and throwing matching exceptions about that. :/
It is possible to have a transpilation test pass if line in the test throws an exception. As long as those exceptions match between JS and Python, that is considered a success. The behaviour will mask issues in tests and turn a test with a error in its expression into a passing test.
This will pass, because both JS and Python will throw a type error about the first line and they will match.
We should catch this exception and fail the test (and fix the tests that currently violate it).