Add unittest for 12540
Merge pull request #2074 from dymk/fix-12540

Add unittest for 12540