Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Failing spec for String#tr. #1872

Closed
wants to merge 1 commit into from

6 participants

@floere

"hello".tr("helo", "1212").should == "12112" but incorrectly results in "122222". The pull request contains a more comprehensive example.

Please also see #1871 for a more in-depth description of the problem.

@travisbot

This pull request fails (merged ccc968e into af9f288).

@ileitch
Collaborator

You forgot to tag it :)

@floere
@floere
@carlosgaldino
Collaborator

@floere http://rubyspec.org/mspec-tag/

More precisely bin/mspec tag spec/ruby/core/string/tr_spec.rb

@floere
@dbussink
Owner

There is actually already a failing spec that we have tagged that exposes the same issue. We don't want to create duplicate specs / add more complex specs if we only really need a simple case to cover the behavior.

I'm actually looking at fixing the already existing specs, to fix the bug we talked about.

@floere

I'm fine with this not getting pulled. So, @dbussink you will fix? Then I'll close this and do not fix?

@floere

@jc00ke Thanks for the link!

I'm closing this one.

@floere floere closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 20, 2012
  1. @floere
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 spec/ruby/core/string/tr_spec.rb
View
4 spec/ruby/core/string/tr_spec.rb
@@ -7,6 +7,10 @@
"hello".tr('aeiou', '*').should == "h*ll*"
"hello".tr('el', 'ip').should == "hippo"
"Lisp".tr("Lisp", "Ruby").should == "Ruby"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".tr(
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+ "2223334445556667777888999922233344455566677778889999"
+ ).should == "2223334445556667777888999922233344455566677778889999"
end
it "accepts c1-c2 notation to denote ranges of characters" do
Something went wrong with that request. Please try again.