Skip to content

Commit

Permalink
[Truffle] Filled in more Encoding::Converter functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Mar 26, 2015
1 parent 594ba7d commit 15ea532
Show file tree
Hide file tree
Showing 8 changed files with 7,701 additions and 54 deletions.
26 changes: 0 additions & 26 deletions spec/truffle/tags/core/encoding/converter/constants_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Encoding::Converter#convpath indicates if crlf_newline conversion would occur
slow:Encoding::Converter#convpath returns an Array
slow:Encoding::Converter#convpath returns each encoding pair as a sub-Array
slow:Encoding::Converter#convpath returns each encoding as an Encoding object
Expand Down
1 change: 0 additions & 1 deletion spec/truffle/tags/core/encoding/converter/inspect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Encoding::Converter#inspect needs to be reviewed for spec completeness
fails:Encoding::Converter#inspect includes the source and destination encodings in the return value
18 changes: 0 additions & 18 deletions spec/truffle/tags/core/encoding/converter/new_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
fails:Encoding::Converter#replacement returns '?' in US-ASCII when the destination encoding is not UTF-8
fails:Encoding::Converter#replacement returns \uFFFD when the destination encoding is UTF-8
fails:Encoding::Converter#replacement= accepts a String argument
fails:Encoding::Converter#replacement= accepts a String argument of arbitrary length
fails:Encoding::Converter#replacement= raises a TypeError if assigned a non-String argument
fails:Encoding::Converter#replacement= sets #replacement
fails:Encoding::Converter#replacement= raises an UndefinedConversionError is the argument cannot be converted into the destination encoding
fails:Encoding::Converter#replacement= does not change the replacement character if the argument cannot be converted into the destination encoding
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Encoding::Converter.search_convpath returns multiple encoding pairs when direct conversion is impossible
fails:Encoding::Converter.search_convpath indicates if crlf_newline conversion would occur
slow:Encoding::Converter.search_convpath returns an Array
slow:Encoding::Converter.search_convpath returns each encoding pair as a sub-Array
slow:Encoding::Converter.search_convpath returns each encoding as an Encoding object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.jcodings.Encoding;
import org.jcodings.EncodingDB;
import org.jcodings.transcode.EConvFlags;
import org.jruby.runtime.Constants;
import org.jruby.runtime.encoding.EncodingService;
import org.jruby.runtime.load.LoadServiceResource;
Expand Down Expand Up @@ -418,6 +419,20 @@ private void initializeConstants() {

processClass.setConstant(null, "CLOCK_MONOTONIC", ProcessNodes.CLOCK_MONOTONIC);
processClass.setConstant(null, "CLOCK_REALTIME", ProcessNodes.CLOCK_REALTIME);

encodingConverterClass.setConstant(null, "INVALID_MASK", EConvFlags.INVALID_MASK);
encodingConverterClass.setConstant(null, "INVALID_REPLACE", EConvFlags.INVALID_REPLACE);
encodingConverterClass.setConstant(null, "UNDEF_MASK", EConvFlags.UNDEF_MASK);
encodingConverterClass.setConstant(null, "UNDEF_REPLACE", EConvFlags.UNDEF_REPLACE);
encodingConverterClass.setConstant(null, "UNDEF_HEX_CHARREF", EConvFlags.UNDEF_HEX_CHARREF);
encodingConverterClass.setConstant(null, "PARTIAL_INPUT", EConvFlags.PARTIAL_INPUT);
encodingConverterClass.setConstant(null, "AFTER_OUTPUT", EConvFlags.AFTER_OUTPUT);
encodingConverterClass.setConstant(null, "UNIVERSAL_NEWLINE_DECORATOR", EConvFlags.UNIVERSAL_NEWLINE_DECORATOR);
encodingConverterClass.setConstant(null, "CRLF_NEWLINE_DECORATOR", EConvFlags.CRLF_NEWLINE_DECORATOR);
encodingConverterClass.setConstant(null, "CR_NEWLINE_DECORATOR", EConvFlags.CR_NEWLINE_DECORATOR);
encodingConverterClass.setConstant(null, "XML_TEXT_DECORATOR", EConvFlags.XML_TEXT_DECORATOR);
encodingConverterClass.setConstant(null, "XML_ATTR_CONTENT_DECORATOR", EConvFlags.XML_ATTR_CONTENT_DECORATOR);
encodingConverterClass.setConstant(null, "XML_ATTR_QUOTE_DECORATOR", EConvFlags.XML_ATTR_QUOTE_DECORATOR);
}

private void initializeSignalConstants() {
Expand Down
Loading

0 comments on commit 15ea532

Please sign in to comment.