exhaustive test of String#trim behavior

This should close #253.