This behavior (from commit 539e4a77 in 2013) was untested. The test can help detect regression introduced by 886715af