Skip to content

Inconsistent String behavior between MRI and JRuby #8624

@Maumagnaguagno

Description

@Maumagnaguagno

Yesterday I noticed an inconsistent behavior related to Strings using GitHub Actions and jruby-head.
Today I was able to obtain the following minimal reproducible example using Linux and RVM:

s = '!test'
s.delete_prefix!('!')
p s
s.tr!('-','_')
p s

The expected behavior is to output "test" twice.
Output of MRI 3.4.1:

"test"
"test"

Output of JRuby head (CI environment) and JRuby 9.4.10.0 (RVM locally):

"test"
"est\u0000"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions