Add regression test for issue #1939