Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 64638d0b90bf
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: af5720de5c13
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Mar 3, 2016

  1. Remaining fix for IO#each_codepoint.

    Fixes MRI TestIO_M17N#test_each_codepoint_need_more.
    headius committed Mar 3, 2016
    Copy the full SHA
    ca41024 View commit details
  2. Copy the full SHA
    0650a56 View commit details
  3. Copy the full SHA
    af5720d View commit details
Showing with 10 additions and 6 deletions.
  1. +7 −2 core/src/main/java/org/jruby/RubyIO.java
  2. +2 −2 lib/pom.xml
  3. +0 −1 test/mri/excludes/TestIO_M17N.rb
  4. +1 −1 test/mri/ruby/test_io_m17n.rb
9 changes: 7 additions & 2 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -3142,6 +3142,7 @@ private IRubyObject eachCodePointCommon(ThreadContext context, Block block, Stri
fptr.READ_CHECK(context);
if (fptr.needsReadConversion()) {
fptr.SET_BINARY_MODE();
r = 1; /* no invalid char yet */
for (;;) {
fptr.makeReadConversion(context);
for (;;) {
@@ -3158,12 +3159,16 @@ private IRubyObject eachCodePointCommon(ThreadContext context, Block block, Stri
}
if (fptr.moreChar(context) == OpenFile.MORE_CHAR_FINISHED) {
fptr.clearReadConversion();
/* ignore an incomplete character before EOF */
if (!StringSupport.MBCLEN_CHARFOUND_P(r)) {
enc = fptr.encs.enc;
throw runtime.newArgumentError("invalid byte sequence in " + enc.toString());
}
return this;
}
}
if (StringSupport.MBCLEN_INVALID_P(r)) {
throw runtime.newArgumentError("invalid byte sequence in " + fptr.encs.enc.toString());
enc = fptr.encs.enc;
throw runtime.newArgumentError("invalid byte sequence in " + enc.toString());
}
n = StringSupport.MBCLEN_CHARFOUND_LEN(r);
if (fptr.encs.enc != null) {
4 changes: 2 additions & 2 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ DO NOT MODIFIY - GENERATED CODE
<plugin>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-maven-plugin</artifactId>
<version>0.1.15</version>
<version>0.1.11</version>
<executions>
<execution>
<id>install_gems</id>
@@ -327,7 +327,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.15</version>
<version>0.1.11</version>
</dependency>
</dependencies>
</plugin>
1 change: 0 additions & 1 deletion test/mri/excludes/TestIO_M17N.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
exclude :test_both_textmode_binmode, "needs investigation"
exclude :test_cbuf, "needs investigation"
exclude :test_each_codepoint_need_more, "times out, but doesn't pass even with longer timeout"
exclude :test_error_nonascii, "needs investigation"
exclude :test_getc_newlineconv_invalid, "needs investigation"
exclude :test_inspect_nonascii, "needs investigation"
2 changes: 1 addition & 1 deletion test/mri/ruby/test_io_m17n.rb
Original file line number Diff line number Diff line change
@@ -2626,7 +2626,7 @@ def test_each_codepoint_need_more
begin
assert_in_out_err(args, "", out, err,
"#{bug11444}: #{test} in #{mode} mode",
timeout: 1)
timeout: 10)
rescue Exception => e
failure << e
end