added unit tests for #5249