Add a test case for bug 3251

It was closed in 5b39c3535f7b3383d89d7b844537244a4e7c0eca.