-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix string concatenation with a number as per rubyspec behaviour.
Following tychobrailleur/jcodings@8536b4f, the incorrect behaviour of String#concat with a number was made obvious by throwing an EncodingException. MRI changes the encoding of the String if the concatenated codepoint is within ASCII-8BIT range, and throws a RangeError otherwise.
- Loading branch information
1 parent
fe78661
commit f4bd113
Showing
2 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
fails:String#concat with Integer returns a ASCII-8BIT string if self is US-ASCII and the argument is between 128-255 (inclusive) | ||
fails:String#concat with Integer raises RangeError if the argument is an invalid codepoint for self's encoding | ||
fails:String#concat when self is ASCII-8BIT and argument is US-ASCII uses ASCII-8BIT encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters