Added test case for erase function