test coverage for three branches in String#to*