Improve the unit test for #1742