completed str.rstrip() with tests