A note on testing shell scripts
I write a lot of small bash scripts and almost never test them. This week I added two tests with bats and found a quoting bug that would have eaten a filename with spaces. The tests aren't clever: make a temp dir, run the script, assert output. Ten lines. I won't pretend this makes bash pleasant, but a couple of tests turn it from 'hope it works' into 'probably works'.
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.