Fix exception while watching files and adding a new test

Sometimes getsourcelines is not able to find the source code, and raises an
IndexError exception. In these cases mamba puts the test at the end.