diff options
author | Koichi Sasada <[email protected]> | 2020-12-18 09:12:26 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-12-18 09:12:26 +0900 |
commit | 51c2725dc646030283d01ce23a32c06f0f1c8bf6 () | |
tree | 61f3f8400a1b819a5e19fcf67d9a9230ae13fc86 /test/ruby/test_regexp.rb | |
parent | 29e42b8bfdfc7a2d879a4ddb1db3d4453d66143a (diff) |
use eval to create different Regexp objects
Only one warning is shown for the same Regexp object, so create different objects to support repeating tests. http://ci.rvm.jp/results/trunk-repeat20@phosphorus-docker/3290658
-rw-r--r-- | test/ruby/test_regexp.rb | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -561,7 +561,10 @@ class TestRegexp < Test::Unit::TestCase assert_equal("bc", /../.match('abc', -2)[0]) assert_nil(/../.match("abc", -4)) assert_nil(/../.match("abc", 4)) - assert_equal('\x', assert_warning(/binary regexp/) {/../n.match("\u3042" + '\x', 1)}[0]) r = nil /.../.match("abc") {|m| r = m[0] } @@ -726,7 +729,9 @@ class TestRegexp < Test::Unit::TestCase end def test_rindex_regexp - assert_equal(3, assert_warning(/binary regexp/) {"foobarbaz\u3042".rindex(/b../n, 5)}) end def assert_regexp(re, ss, fs = [], msg = nil) |