Unit test for issue 6366