Unit test for #3589