1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* regparse.c (add_code_range_to_buf0): fix false negative

warning when given range is just before previous range.
  [ruby-dev:41406]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-05-25 15:12:19 +00:00
parent 415be47593
commit 81c5ede3ca
3 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Tue May 25 14:00:51 2010 NARUSE, Yui <naruse@ruby-lang.org>
* regparse.c (add_code_range_to_buf0): fix false negative
warning when given range is just before previous range.
[ruby-dev:41406]
Tue May 25 16:37:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-style.el (ruby-style-version): take revision if

View file

@ -1750,12 +1750,11 @@ add_code_range_to_buf0(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePo
return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;
if (inc_n != 1) {
if (checkdup && to >= data[low*2]) CC_DUP_WARN(env);
if (from > data[low*2])
from = data[low*2];
else if (checkdup) CC_DUP_WARN(env);
if (to < data[(high - 1)*2 + 1])
to = data[(high - 1)*2 + 1];
else if (checkdup) CC_DUP_WARN(env);
}
if (inc_n != 0 && (OnigCodePoint )high < n) {

View file

@ -1,4 +1,5 @@
require 'test/unit'
require_relative 'envutil'
class TestRegexp < Test::Unit::TestCase
def setup
@ -816,4 +817,10 @@ class TestRegexp < Test::Unit::TestCase
bug2547 = '[ruby-core:27374]'
assert_raise(SyntaxError, bug2547) {eval('/#{"\\\\"}y/')}
end
def test_dup_warn
assert_in_out_err('-w', 'x=/[\u3042\u3041]/', [], /\A\z/)
assert_in_out_err('-w', 'x=/[\u3042\u3042]/', [], /duplicated/)
assert_in_out_err('-w', 'x=/[\u3042\u3041-\u3043]/', [], /duplicated/)
end
end