added unit test for #5796