I think it depends on the situation. I find myself writing tests when I begin to fear how different inputs will be processed, especially in combination.
Discussion
You should only write tests when that part of the codebase has real users relying on it not breaking, real contributors who might inadvertantly break it, and everyone involved has reason to believe that further experimentation is pointless.