If I'm answering someone's question, instead of saying "your code will fail on input x, y or z", should I provide a unit test snippet?
I think in general our answers should be concise and clear. It units help us communicate something then perhaps they should be included. If they merely clutter the answer then I'd say no.
I don't think it's bad to include a reproducible test-case that shows where the code went wrong. But don't get bogged down in anything irrelevant to the task at hand. So don't bother writing a full testing harness, just post the relevant bit. So if it's a function that throws an exception when fed
func('foo'); // <-- throws exception
But at the same time, if you need more code, absolutely post it...