[macruby-changes] [MacRuby/MacRuby] f04df7: fix a bug of Regexp#match. Regexp#match(str, pos) ...

noreply at github.com noreply at github.com
Wed Jun 22 20:47:44 PDT 2011


  Branch: refs/heads/master
  Home:   https://github.com/MacRuby/MacRuby

  Commit: f04df77691d7f2e3bbd5005183d34c9ed972274c
      https://github.com/MacRuby/MacRuby/commit/f04df77691d7f2e3bbd5005183d34c9ed972274c
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-06-22 (Wed, 22 Jun 2011)

  Changed paths:
    M re.h

  Log Message:
  -----------
  fix a bug of Regexp#match. Regexp#match(str, pos) was broken when was passed a pos.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

str = 'This is an example string'
reg = Regexp.new(/\w+/)
assert_equal("is", reg.match(str, 4)[0])
assert_equal("an", reg.match(str, 8)[0])
assert_equal("g", reg.match(str, -1)[0])

puts :ok
}}}




More information about the macruby-changes mailing list