Add unit test for #1048.