TST: Add regression test for #1025.