Add a test for the infinite loop.
Make the tests pass.