aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-20 06:47:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-20 06:47:37 +0000
commit90a9db6e6c04a4d82b8b032a83ed0e11e68b40d0 (patch)
treeb5e3e5b6a9d97e7e6c3fe9aeb69d6d05a4a3f03b /test/ruby/test_regexp.rb
parentf9a2d6b9d9e02da536e218e4c0bb021b09377a5e (diff)
downloadruby-90a9db6e6c04a4d82b8b032a83ed0e11e68b40d0.tar.gz
test_regexp.rb: split test_once
* test/ruby/test_regexp.rb (test_once): split for each cases than separating by comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 2cd8e13352..1ef5bb2d1b 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -1008,8 +1008,9 @@ class TestRegexp < Test::Unit::TestCase
assert_equal(/0/, pr1.call(0))
assert_equal(/0/, pr1.call(1))
assert_equal(/0/, pr1.call(2))
+ end
- # recursive
+ def test_once_recursive
pr2 = proc{|i|
if i > 0
/#{pr2.call(i-1).to_s}#{i}/
@@ -1018,8 +1019,9 @@ class TestRegexp < Test::Unit::TestCase
end
}
assert_equal(/(?-mix:(?-mix:(?-mix:)1)2)3/, pr2.call(3))
+ end
- # multi-thread
+ def test_once_multithread
m = Mutex.new
pr3 = proc{|i|
/#{m.unlock; sleep 0.5; i}/o
@@ -1030,8 +1032,9 @@ class TestRegexp < Test::Unit::TestCase
th2 = Thread.new{m.lock; ary << pr3.call(n+=1)}
th1.join; th2.join
assert_equal([/1/, /1/], ary)
+ end
- # escape
+ def test_once_escape
pr4 = proc{|i|
catch(:xyzzy){
/#{throw :xyzzy, i}/o =~ ""