Add a test case for trim_trailing_slashes, and make it handle other cases.