diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index fd3b19406c..3067809153 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -574,9 +574,9 @@ module Test jobs_status(worker) when /^done (.+?)$/ begin - r = Marshal.load($1.unpack("m")[0]) + r = Marshal.load($1.unpack1("m")) rescue - print "unknown object: #{$1.unpack("m")[0].dump}" + print "unknown object: #{$1.unpack1("m").dump}" return true end result << r[0..1] unless r[0..1] == [nil,nil] @@ -587,7 +587,7 @@ module Test return true when /^record (.+?)$/ begin - r = Marshal.load($1.unpack("m")[0]) + r = Marshal.load($1.unpack1("m")) suite = r.first key = [worker.name, suite] @@ -597,18 +597,18 @@ module Test @records[key] = [worker.start_time, Time.now] end rescue => e - print "unknown record: #{e.message} #{$1.unpack("m")[0].dump}" + print "unknown record: #{e.message} #{$1.unpack1("m").dump}" return true end record(fake_class(r[0]), *r[1..-1]) when /^p (.+?)$/ del_jobs_status - print $1.unpack("m")[0] + print $1.unpack1("m") jobs_status(worker) if @options[:job_status] == :replace when /^after (.+?)$/ - @warnings << Marshal.load($1.unpack("m")[0]) + @warnings << Marshal.load($1.unpack1("m")) when /^bye (.+?)$/ - after_worker_down worker, Marshal.load($1.unpack("m")[0]) + after_worker_down worker, Marshal.load($1.unpack1("m")) when /^bye$/, nil if shutting_down || worker.quit_called after_worker_quit worker diff --git a/tool/lib/test/unit/parallel.rb b/tool/lib/test/unit/parallel.rb index 96aadf0249..db2d918331 100644 --- a/tool/lib/test/unit/parallel.rb +++ b/tool/lib/test/unit/parallel.rb @@ -107,7 +107,7 @@ module Test case buf.chomp when /^loadpath (.+?)$/ @old_loadpath = $:.dup - $:.push(*Marshal.load($1.unpack("m")[0].force_encoding("ASCII-8BIT"))).uniq! + $:.push(*Marshal.load($1.unpack1("m").force_encoding("ASCII-8BIT"))).uniq! when /^run (.+?) (.+?)$/ _report "okay" diff --git a/tool/test/testunit/test_parallel.rb b/tool/test/testunit/test_parallel.rb index 297ff414ed..8207e71868 100644 --- a/tool/test/testunit/test_parallel.rb +++ b/tool/test/testunit/test_parallel.rb @@ -99,7 +99,7 @@ module TestParallel break if /^p (.+?)$/ =~ buf end assert_not_nil($1, "'p' was not found") - assert_match(/TestA#test_nothing_test = \d+\.\d+ s = \.\n/, $1.chomp.unpack("m")[0]) + assert_match(/TestA#test_nothing_test = \d+\.\d+ s = \.\n/, $1.chomp.unpack1("m")) end end @@ -111,7 +111,7 @@ module TestParallel end assert_not_nil($1, "'done' was not found") - result = Marshal.load($1.chomp.unpack("m")[0]) + result = Marshal.load($1.chomp.unpack1("m")) assert_equal(5, result[0]) pend "TODO: result[1] returns 17. We should investigate it" do assert_equal(12, result[1])