[#47409] [ruby-trunk - Feature #6973][Open] Add an #integral? method to Numeric to test for whole-number values — "regularfry (Alex Young)" <alex@...>

12 messages 2012/09/03

[#47481] [ruby-trunk - Bug #7008][Open] rake is crashing when trying to compile ffi gem — "drookie (Eugene M. Zheganin Eugene M. Zheganin)" <eugene@...>

10 messages 2012/09/12

[#47505] [ruby-trunk - Feature #7019][Open] allow `private` and `protected` keywords to take blocks — "alexeymuranov (Alexey Muranov)" <redmine@...>

15 messages 2012/09/13

[#47582] [ruby-trunk - Bug #7037][Open] float formatting inconsistently rounds half to even — "headius (Charles Nutter)" <headius@...>

14 messages 2012/09/19

[#47638] [ruby-trunk - Bug #7046][Open] ERB#run and ERB#result are not safe for concurrent use — "headius (Charles Nutter)" <headius@...>

11 messages 2012/09/21

[#47655] [ruby-trunk - Feature #7051][Open] Extend caller_locations API to include klass and bindings. Allow caller_locations as a method hanging off Thread. — "sam.saffron (Sam Saffron)" <sam.saffron@...>

13 messages 2012/09/23

[#47657] [ruby-trunk - Feature #7055][Open] Allow `.foo=` as a synonym of `self.foo=` — "alexeymuranov (Alexey Muranov)" <redmine@...>

11 messages 2012/09/23

[#47730] [ruby-trunk - Bug #7085][Open] Subversion → GitHub gateway stops. — "shyouhei (Shyouhei Urabe)" <shyouhei@...>

27 messages 2012/09/29

[#47735] [ruby-trunk - Bug #7087][Open] ::ConditionVariable#wait does not work with Monitor because Monitor#sleep does not exist — "rklemme (Robert Klemme)" <shortcutter@...>

10 messages 2012/09/29

[#47759] [ruby-trunk - Bug #7092][Open] StringScanner start-of-line matches false positives, while lookbehind for a newline gives false negatives — "jayferd (Jay Adkisson)" <jjmadkisson@...>

8 messages 2012/09/30

[ruby-core:47709] [ruby-trunk - Bug #7076][Open] TestUnicodeEscape#test_basic failure on Windows

From: "h.shirosaki (Hiroshi Shirosaki)" <h.shirosaki@...>
Date: 2012-09-27 12:44:25 UTC
List: ruby-core #47709
Issue #7076 has been reported by h.shirosaki (Hiroshi Shirosaki).

----------------------------------------
Bug #7076: TestUnicodeEscape#test_basic failure on Windows
https://bugs.ruby-lang.org/issues/7076

Author: h.shirosaki (Hiroshi Shirosaki)
Status: Open
Priority: Normal
Assignee: 
Category: test
Target version: 
ruby -v: ruby 2.0.0dev (2012-09-27 trunk 37040) [i386-mingw32]


=begin
This was originally reported at rubyinstaller-list by Jon.

With chcp 437, TestUnicodeEscape#test_basic fails with invalid byte sequence in UTF-8.

http://pastie.org/4688083


I got the following test failure with chcp 437 on Windows 7.


 1) Failure:
 test_basic(TestUnicodeEscape) [c:/Users/hiroshi/work/ruby/test/ruby/test_unicode_escape.rb:50]:
 Expected /^("?)\u00FC\1$/ to match "\"??\"\n".


echo command on Windows seems not to work properly against non-ascii characters with all code page.

I suggest a patch to use ruby instead of echo.
This patch works fine with chcp 437, 1252 and 65001. Jon also confirmed this.


 diff --git a/test/ruby/test_unicode_escape.rb b/test/ruby/test_unicode_escape.rb
 index 088f81c..2c437d9 100644
 --- a/test/ruby/test_unicode_escape.rb
 +++ b/test/ruby/test_unicode_escape.rb
 @@ -1,6 +1,7 @@
  # -*- coding: utf-8 -*-
  
  require 'test/unit'
 +require_relative 'envutil'
  
  class TestUnicodeEscape < Test::Unit::TestCase
    def test_basic
 @@ -47,7 +48,7 @@ EOS
      # \u in %x strings
      assert_match(/^("?)A\1$/, `echo "\u0041"`) #"
      assert_match(/^("?)A\1$/, %x{echo "\u0041"}) #"
 -    assert_match(/^("?)端\1$/, `echo "\u{FC}"`.force_encoding("utf-8")) #"
 +    assert_match(/^("?)端\1$/, `#{EnvUtil.rubybin} -e "puts \\"\u{FC}\\""`.force_encoding("utf-8")) #"
  
      # \u in quoted symbols
      assert_equal(:A, :"\u0041")=end


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next