summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-08-05 22:11:52 +0900
committerNobuyoshi Nakada <[email protected]>2023-09-25 22:57:28 +0900
commit7e2775b057d19d5ed06877c3b02299e3b5d2beb7 (patch)
treebc78bf65a2be58d00212e1eb4dcbc927be968560 /test/ruby/test_rubyoptions.rb
parent0f642907046e98cc026b50416bd63212b92112cd (diff)
Invoke the command when RUBY_BUGREPORT_PATH starts with `|`
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 14264698d3..884a5af32e 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -880,6 +880,21 @@ class TestRubyOptions < Test::Unit::TestCase
end
end
+ def test_bugreport_path_pipe
+ if File.executable?(echo = "/bin/echo")
+ elsif /mswin|ming/ =~ RUBY_PLATFORM
+ echo = "echo"
+ else
+ omit "/bin/echo not found"
+ end
+ assert_in_out_err([{"RUBY_BUGREPORT_PATH"=>"| #{echo} %e:%f:%p"}], SEGVTest::KILL_SELF,
+ encoding: "ASCII-8BIT",
+ **SEGVTest::ExecOptions) do |stdout, stderr, status|
+ assert_empty(stderr)
+ assert_equal(["#{File.basename(EnvUtil.rubybin)}:-:#{status.pid}"], stdout)
+ end
+ end
+
def test_DATA
Tempfile.create(["test_ruby_test_rubyoption", ".rb"]) {|t|
t.puts "puts DATA.read.inspect"