Added test for #6171