Add test cases for #4