Thank you for your suggestion. IMHO I'm not sure we need to have a regression test for this bug as it's just an oversight of recently committed code. My suggestion was just to help Stepan reproduce this failure using TAP tests.
Yes, I have reproduced the issue manually before your changes, but I am unable to do so in the perl test.