Add a regression test for bug 3001

I haven't actually tested that the test suite passes with this, but will do so soon (it seems rather small, though).