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

test_regexp.rb: assert prefix

* test/ruby/test_regexp.rb: rename and prefix `assert_` to show
  caller method names in backtrace.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-20 06:47:10 +00:00
parent c63170c917
commit f9a2d6b9d9

View file

@ -586,7 +586,7 @@ class TestRegexp < Test::Unit::TestCase
assert_predicate(m, :tainted?)
end
def check(re, ss, fs = [], msg = nil)
def assert_regexp(re, ss, fs = [], msg = nil)
re = Regexp.new(re) unless re.is_a?(Regexp)
ss = [ss] unless ss.is_a?(Array)
ss.each do |e, s|
@ -598,10 +598,12 @@ class TestRegexp < Test::Unit::TestCase
fs = [fs] unless fs.is_a?(Array)
fs.each {|s| assert_no_match(re, s, msg) }
end
alias check assert_regexp
def failcheck(re)
def assert_fail(re)
assert_raise(RegexpError) { %r"#{ re }" }
end
alias failcheck assert_fail
def test_parse
check(/\*\+\?\{\}\|\(\)\<\>\`\'/, "*+?{}|()<>`'")