Add test for issue 5719

fixes #5719