Add tests for #3589