summaryrefslogtreecommitdiff
path: root/test/ruby/test_system.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r--test/ruby/test_system.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 903918812d..0fbad0af33 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -46,6 +46,18 @@ class TestSystem < Test::Unit::TestCase
assert_equal('555', `#{ruby} -x #{tmpfilename} -zzz=555`)
tmp = open(tmpfilename, "w")
+ tmp.print "#! /non/exist\\interpreter?/./to|be:ignored\n";
+ tmp.print "this is a leading junk\n";
+ tmp.print "#! /usr/local/bin/ruby -s\n";
+ tmp.print "print $zzz\n";
+ tmp.print "__END__\n";
+ tmp.print "this is a trailing junk\n";
+ tmp.close
+
+ assert_equal('', `#{ruby} #{tmpfilename}`)
+ assert_equal('555', `#{ruby} #{tmpfilename} -zzz=555`)
+
+ tmp = open(tmpfilename, "w")
for i in 1..5
tmp.print i, "\n"
end