зеркало из https://github.com/github/ruby.git
support `skip` in bootstraptest
This commit is contained in:
Родитель
5a66ea23d2
Коммит
9b4cb69a88
|
@ -552,8 +552,13 @@ class Assertion < Struct.new(:src, :path, :lineno, :proc)
|
|||
filename = "bootstraptest.#{self.path}_#{self.lineno}_#{self.id}.rb"
|
||||
File.open(filename, 'w') {|f|
|
||||
f.puts "#frozen_string_literal:true" if frozen_string_literal
|
||||
if $stress
|
||||
f.puts "GC.stress = true" if $stress
|
||||
f.puts "print(begin; #{self.src}; end)"
|
||||
else
|
||||
f.puts ""
|
||||
end
|
||||
f.puts "class BT_Skip < Exception; end; def skip(msg) = raise(BT_Skip, msg.to_s)"
|
||||
f.puts "print(begin; #{self.src}; rescue BT_Skip; $!.message; end)"
|
||||
}
|
||||
filename
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче