summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 00:07:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 00:07:32 +0000
commitba661182a40a486f089e63889897ab98d9db85b5 (patch)
tree96d46c646be16291fa4dcc7a3e91884a5c099eb7 /test/testunit
parentc50c1a0064ac9757fabf80ba16b324f5950af2c4 (diff)
* test/testunit/tests_for_parallel/ptest_forth.rb: added a test case
which causes an error. * test/testunit/test_parallel.rb: follow above change. see [Bug #6882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test_parallel.rb9
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb7
2 files changed, 11 insertions, 5 deletions
diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb
index 9d1bc57..00883e9 100644
--- a/test/testunit/test_parallel.rb
+++ b/test/testunit/test_parallel.rb
@@ -91,7 +91,7 @@ module TestParallel
timeout(10) do
@worker_in.puts "run #{TESTS}/ptest_forth.rb test"
i = 0
- 5.times { @worker_out.gets }
+ 6.times { @worker_out.gets }
buf = @worker_out.gets
assert_match(/^done (.+?)$/, buf)
@@ -99,14 +99,15 @@ module TestParallel
result = Marshal.load($1.chomp.unpack("m")[0])
- assert_equal(result[0],3)
- assert_equal(result[1],2)
+ assert_equal(4, result[0])
+ assert_equal(2, result[1])
assert_kind_of(Array,result[2])
assert_kind_of(Array,result[3])
assert_kind_of(Array,result[4])
assert_kind_of(Array,result[2][1])
assert_kind_of(MiniTest::Assertion,result[2][0][2])
assert_kind_of(MiniTest::Skip,result[2][1][2])
+ assert_kind_of(Exception, result[2][2][2])
assert_equal(result[5], "TestE")
end
end
@@ -156,7 +157,7 @@ module TestParallel
def test_should_run_all_without_any_leaks
spawn_runner
buf = timeout(10){@test_out.read}
- assert_match(/^[SF\.]{7}$/,buf)
+ assert_match(/^[SFE\.]{8}$/,buf)
end
def test_should_retry_failed_on_workers
diff --git a/test/testunit/tests_for_parallel/ptest_forth.rb b/test/testunit/tests_for_parallel/ptest_forth.rb
index c778a2e..ad5a7f3 100644
--- a/test/testunit/tests_for_parallel/ptest_forth.rb
+++ b/test/testunit/tests_for_parallel/ptest_forth.rb
@@ -1,6 +1,8 @@
require 'test/unit'
class TestE < Test::Unit::TestCase
+ class UnknownError < RuntimeError; end
+
def test_not_fail
assert_equal(1,1)
end
@@ -12,5 +14,8 @@ class TestE < Test::Unit::TestCase
def test_always_fail
assert_equal(0,1)
end
-end
+ def test_unknown_error
+ raise UnknownError, "unknown error"
+ end
+end