add test cases for #6139 and #6128