From 90a9db6e6c04a4d82b8b032a83ed0e11e68b40d0 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 20 Jun 2014 06:47:37 +0000 Subject: [PATCH] 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 --- test/ruby/test_regexp.rb | 9 ++++++--- 1 file 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 =~ ""