mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_cgi.rb: skip a test on Windows
* test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test depending on locale on Windows. ENV[] doesn't work properly if console code page is not equal to file system encoding. [ruby-core:47910] [Bug #7140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7206f9bc79
commit
25a79e9f9b
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Oct 12 21:37:25 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||
|
||||
* test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test
|
||||
depending on locale on Windows. ENV[] doesn't work properly if
|
||||
console code page is not equal to file system encoding.
|
||||
[ruby-core:47910] [Bug #7140]
|
||||
|
||||
Fri Oct 12 20:40:29 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (posix_sh_cmds): the command name of colon is ":".
|
||||
|
|
|
@ -37,8 +37,13 @@ class TestWEBrickCGI < Test::Unit::TestCase
|
|||
req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar")
|
||||
http.request(req){|res| assert_equal("/???", res.body, log.call)}
|
||||
req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2")
|
||||
http.request(req){|res|
|
||||
assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)}
|
||||
# Path info of res.body is passed via ENV.
|
||||
# ENV[] returns different value on Windows depending on locale.
|
||||
unless RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ &&
|
||||
Encoding.find("locale") != Encoding.find("filesystem")
|
||||
http.request(req){|res|
|
||||
assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)}
|
||||
end
|
||||
req = Net::HTTP::Get.new("/webrick.cgi?a=1;a=2;b=x")
|
||||
http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body, log.call)}
|
||||
req = Net::HTTP::Get.new("/webrick.cgi?a=1&a=2&b=x")
|
||||
|
|
Loading…
Reference in a new issue