Regexp \G behaves differently from MRI
--------------------------------------

                 Key: JRUBY-1171
                 URL: http://jira.codehaus.org/browse/JRUBY-1171
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: MacOS / MSWindows
            Reporter: Dmitry Verkhovsky


JRuby returns nil instead of 0 on following:

irb(main):001:0> "a".index(/\Ga/)
 => 0

Jirb(main):001:0> "a".index(/\Ga/)
 => nil


Unit test:
TestRubyString.java

package org.jruby.test;

import org.jruby.Ruby;

public class TestRubyString extends TestRubyBase {

    private String result;

    public TestRubyString(String name) {
        super(name);
    }

    public void setUp() throws Exception {
        if (runtime == null) {
            runtime = Ruby.getDefaultInstance();
        }
    }

    public void tearDown() {
        super.tearDown();
    }

    public void testConstructors() throws Exception {
        result = eval("p \"a\".index(/\\Ga/)");
        assertEquals("0", result);
    }
}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to