How to test that a function doesn't infinite loop

thanks my issue has been fixed.