Test case for repeated deletion bug in issue #18508

Updated test case for repeated deletion bug in issue #18508.