summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_system.rb30
1 files changed, 24 insertions, 6 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 3d55eee725..bb77ad445e 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -90,20 +90,38 @@ class TestSystem < Test::Unit::TestCase
def test_system_at
if /mswin|mingw/ =~ RUBY_PLATFORM
- testname = '[ruby-core:35218]'
+ bug4393 = '[ruby-core:35218]'
+ bug4396 = '[ruby-core:35227]'
# @ + builtin command
- assert_equal("foo\n", `@echo foo`, testname);
- assert_equal("foo\n", `@@echo foo`, testname);
+ assert_equal("foo\n", `@echo foo`, bug4393);
+ assert_equal("foo\n", `@@echo foo`, bug4393);
+ assert_equal("@@foo\n", `@@echo @@foo`, bug4393);
+
+ # "" + @ + built-in
+ assert_equal("@@foo\n", `"echo" @@foo`, bug4396);
+ assert_equal("@@foo\n", `"@@echo" @@foo`, bug4396);
+ assert_equal("@@foo\n", `"@@echo @@foo"`, bug4396);
+ assert_equal('"@foo"\n', `"echo" "@foo"`, bug4396);
+
+ # ^ + @ + built-in
+ assert_equal(nil, system('^@echo foo'), bug4396);
+ assert_equal(nil, system('"^@echo foo"'), bug4396);
+ assert_equal("@foo\n", `echo ^@foo`);
- # @ + non builtin command
Dir.mktmpdir("ruby_script_tmp") {|tmpdir|
tmpfilename = "#{tmpdir}/ruby_script_tmp.#{$$}"
tmp = open(tmpfilename, "w")
- tmp.print "foo\nbar\nbaz";
+ tmp.print "foo\nbar\nbaz\n@foo";
tmp.close
- assert_match(/\Abar\nbaz\n?\z/, `@@findstr "ba" #{tmpfilename.gsub("/", "\\")}`, testname);
+
+ # @ + non builtin command
+ assert_match(/\Abar\nbaz\n?\z/, `@@findstr "ba" #{tmpfilename.gsub("/", "\\")}`, bug4393);
+
+ # "" + @ + non built-in
+ assert_match(/\Abar\nbaz\n?\z/, `"@@findstr" "ba" #{tmpfilename.gsub("/", "\\")}`, bug4396);
+ assert_match(/\A@foo\n?\z/, `"@@findstr" "@foo" #{tmpfilename.gsub("/", "\\")}`, bug4396);
}
end
end