mruby-test/mrbgem.rake: fix mrb_state handling bug

You should not pass values from different mrb_state. No one has ever
used test_args for gems, the issue has not been realized.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-08-13 22:51:37 +09:00
parent 4769a474a4
commit 3310e10318
+1 -1
View File
@@ -94,7 +94,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
f.puts %Q[ mrb_const_set(mrb2, mrb_obj_value(mrb2->object_class), mrb_intern_lit(mrb2, "GEMNAME"), mrb_str_new(mrb2, "#{g.name}", #{g.name.length}));]
unless g.test_args.empty?
f.puts %Q[ test_args_hash = mrb_hash_new_capa(mrb, #{g.test_args.length}); ]
f.puts %Q[ test_args_hash = mrb_hash_new_capa(mrb2, #{g.test_args.length}); ]
g.test_args.each do |arg_name, arg_value|
escaped_arg_name = arg_name.gsub('\\', '\\\\\\\\').gsub('"', '\"')
escaped_arg_value = arg_value.gsub('\\', '\\\\\\\\').gsub('"', '\"')