Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/StringSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,7 @@ public static ByteList caseMap(ThreadContext context, ByteList src, IntHolder fl
tgt = new ByteList(buffer.bytes, 0, buffer.used, enc, false);
} else {
tgt = new ByteList(tgtLen);
tgt.setRealSize(tgtLen);
tgt.setEncoding(enc);
buffer = root.next;
int tgtPos = 0;
Expand Down
4 changes: 4 additions & 0 deletions spec/ruby/core/string/capitalize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"ß".capitalize.should == "Ss"
end

it "returns the whole result when it is much longer than self" do
("\u0130" * 30).capitalize.should == "\u0130" + "i\u0307" * 29
end

it "updates string metadata" do
capitalized = "ßeT".capitalize

Expand Down
8 changes: 8 additions & 0 deletions spec/ruby/core/string/downcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"ÄÖÜ".downcase.should == "äöü"
end

it "returns the whole result when it is much longer than self" do
("\u0130" * 30).downcase.should == "i\u0307" * 30
end

it "updates string metadata" do
downcased = "\u{212A}ING".downcase

Expand Down Expand Up @@ -71,6 +75,10 @@
"ß".downcase.should == "ß"
"ß".downcase(:fold).should == "ss"
end

it "returns the whole result when it is much longer than self" do
("\u0390" * 30).downcase(:fold).should == "\u03B9\u0308\u0301" * 30
end
end

it "does not allow invalid options" do
Expand Down
4 changes: 4 additions & 0 deletions spec/ruby/core/string/swapcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"äÖü".swapcase.should == "ÄöÜ"
end

it "returns the whole result when it is much longer than self" do
("\u0390" * 30).swapcase.should == "\u0399\u0308\u0301" * 30
end

it "updates string metadata" do
swapcased = "Aßet".swapcase

Expand Down
5 changes: 5 additions & 0 deletions spec/ruby/core/string/upcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
"äöü".upcase.should == "ÄÖÜ"
end

it "returns the whole result when it is much longer than self" do
("\u0390" * 30).upcase.should == "\u0399\u0308\u0301" * 30
("a" + "\u0390" * 30).upcase.should == "A" + "\u0399\u0308\u0301" * 30
end

it "updates string metadata" do
upcased = "aßet".upcase

Expand Down
4 changes: 4 additions & 0 deletions spec/ruby/core/symbol/capitalize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@
it "leaves non-alphabetic ASCII characters as they were" do
"Glark?!?".to_sym.capitalize.should == :"Glark?!?"
end

it "returns the whole result when it is much longer than self" do
("\u0130" * 30).to_sym.capitalize.should == ("\u0130" + "i\u0307" * 29).to_sym
end
end
4 changes: 4 additions & 0 deletions spec/ruby/core/symbol/downcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
it "leaves non-alphabetic ASCII characters as they were" do
"Glark?!?".to_sym.downcase.should == :"glark?!?"
end

it "returns the whole result when it is much longer than self" do
("\u0130" * 30).to_sym.downcase.should == ("i\u0307" * 30).to_sym
end
end
4 changes: 4 additions & 0 deletions spec/ruby/core/symbol/swapcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@
it "leaves non-alphabetic ASCII characters as they were" do
"Glark?!?".to_sym.swapcase.should == :"gLARK?!?"
end

it "returns the whole result when it is much longer than self" do
("\u0390" * 30).to_sym.swapcase.should == ("\u0399\u0308\u0301" * 30).to_sym
end
end
4 changes: 4 additions & 0 deletions spec/ruby/core/symbol/upcase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
it "leaves non-alphabetic ASCII characters as they were" do
"Glark?!?".to_sym.upcase.should == :"GLARK?!?"
end

it "returns the whole result when it is much longer than self" do
("\u0390" * 30).to_sym.upcase.should == ("\u0399\u0308\u0301" * 30).to_sym
end
end
Loading