зеркало из https://github.com/github/ruby.git
Родитель
1e73bdbfc4
Коммит
dddc542e9b
|
@ -1248,10 +1248,10 @@ find_cache_index_table(regex_t* reg, OnigStackType *stk, OnigStackIndex *repeat_
|
|||
}
|
||||
|
||||
if (range->upper == 0x7fffffff) {
|
||||
return range->base_num + range->inner_num * range->lower + (is_inc ? 0 : 1) + item->num;
|
||||
return range->base_num + range->inner_num * (range->lower - (is_inc ? 1 : 0)) + (is_inc ? 0 : 1) + item->num;
|
||||
}
|
||||
|
||||
return range->base_num + range->inner_num * range->lower + (range->inner_num + 1) * (count - range->lower) + item->num;
|
||||
return range->base_num + range->inner_num * (range->lower - 1) + (range->inner_num + 1) * (count - range->lower + 1) + item->num;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1765,6 +1765,11 @@ class TestRegexp < Test::Unit::TestCase
|
|||
end;
|
||||
end
|
||||
|
||||
def test_bug_19476 # [Bug #19476]
|
||||
assert_equal("123456789".match(/(?:x?\dx?){2,10}/)[0], "123456789")
|
||||
assert_equal("123456789".match(/(?:x?\dx?){2,}/)[0], "123456789")
|
||||
end
|
||||
|
||||
def test_linear_time_p
|
||||
assert_send [Regexp, :linear_time?, /a/]
|
||||
assert_send [Regexp, :linear_time?, 'a']
|
||||
|
|
Загрузка…
Ссылка в новой задаче