[前][次][番号順一覧][スレッド一覧]

ruby-changes:25115

From: shirosaki <ko1@a...>
Date: Fri, 12 Oct 2012 22:30:25 +0900 (JST)
Subject: [ruby-changes:25115] shirosaki:r37167 (trunk): test_cgi.rb: skip a test on Windows

shirosaki	2012-10-12 22:30:11 +0900 (Fri, 12 Oct 2012)

  New Revision: 37167

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37167

  Log:
    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]

  Modified files:
    trunk/ChangeLog
    trunk/test/webrick/test_cgi.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37166)
+++ ChangeLog	(revision 37167)
@@ -1,3 +1,10 @@
+Fri Oct 12 21:37:25 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* 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@f...>
 
 	* process.c (posix_sh_cmds): the command name of colon is ":".
Index: test/webrick/test_cgi.rb
===================================================================
--- test/webrick/test_cgi.rb	(revision 37166)
+++ test/webrick/test_cgi.rb	(revision 37167)
@@ -37,8 +37,13 @@
       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")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]