Skip to content

rindex() fails on strings read from binary files #2784

Closed
@e2

Description

@e2

Fails on jruby-head, works on jruby-1.7.19

IO.write("data", ":/c")

data = File.open("data", "rb").readlines.first.split(':').last     # => "/c"

result = data.rindex("c")   # => should be 1, but is nil on jruby-head

fail "expected 1, got: #{result.inspect}" unless result == 1

Expected: no failure
Actual: failure on jruby-head (because rindex returns nil)

JRuby: jruby 9.0.0.0-SNAPSHOT (2.2.1) 2015-03-30 8d7c1b1 OpenJDK 64-Bit Server VM 24.75-b04 on 1.7.0_75-b13 +jit [linux-amd64]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions