summaryrefslogtreecommitdiff
path: root/test/ruby/test_system.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:39:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:39:39 +0000
commiteb807d42eca121df22f72b95465bba52a4e7fefa (patch)
tree35b722bc6c94d3b9c5f8f80d41e889c591a80450 /test/ruby/test_system.rb
parentc414d861c109ff546e2bc8c7264859907d6e0f76 (diff)
downloadruby-eb807d42eca121df22f72b95465bba52a4e7fefa.tar.gz
* gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r--test/ruby/test_system.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index f1372781cf..bb77ad445e 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -91,13 +91,24 @@ class TestSystem < Test::Unit::TestCase
def test_system_at
if /mswin|mingw/ =~ RUBY_PLATFORM
bug4393 = '[ruby-core:35218]'
+ bug4396 = '[ruby-core:35227]'
# @ + builtin command
assert_equal("foo\n", `@echo foo`, bug4393);
assert_equal("foo\n", `@@echo foo`, bug4393);
assert_equal("@@foo\n", `@@echo @@foo`, bug4393);
- # @ + non builtin command
+ # "" + @ + 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`);
+
Dir.mktmpdir("ruby_script_tmp") {|tmpdir|
tmpfilename = "#{tmpdir}/ruby_script_tmp.#{$$}"
@@ -105,23 +116,16 @@ class TestSystem < Test::Unit::TestCase
tmp.print "foo\nbar\nbaz\n@foo";
tmp.close
+ # @ + 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
- def test_system_redirect_win
- if /mswin|mingw/ !~ RUBY_PLATFORM
- return
- end
-
- cmd = "%WINDIR%/system32/ping.exe \"BFI3CHL671\" > out.txt 2>NUL"
- assert_equal(false, system(cmd), '[ruby-talk:258939]');
-
- cmd = "\"%WINDIR%/system32/ping.exe BFI3CHL671\" > out.txt 2>NUL"
- assert_equal(false, system(cmd), '[ruby-talk:258939]');
- end
-
def test_empty_evstr
assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]")
end