From 6d1220b0131af25e14f56b1d0b49b8e650376885 Mon Sep 17 00:00:00 2001 From: shirosaki Date: Sat, 29 Sep 2012 11:18:57 +0000 Subject: [PATCH] test_unicode_escape.rb: set script encoding * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic): set script encoding to work with LANG=C. It would work on both Windows and Unix. Refix of r37051. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/ruby/test_unicode_escape.rb | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index deb65d7262..12cc173fef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Sep 29 19:40:32 2012 Hiroshi Shirosaki + + * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic): + set script encoding to work with LANG=C. It would work on both + Windows and Unix. Refix of r37051. + Sat Sep 29 11:21:06 2012 Shugo Maeda * vm_insnhelper.c (rb_vm_using_modules): use using_modules before diff --git a/test/ruby/test_unicode_escape.rb b/test/ruby/test_unicode_escape.rb index af09428421..c1b1e2ca40 100644 --- a/test/ruby/test_unicode_escape.rb +++ b/test/ruby/test_unicode_escape.rb @@ -48,11 +48,8 @@ EOS # \u in %x strings assert_match(/^("?)A\1$/, `echo "\u0041"`) #" assert_match(/^("?)A\1$/, %x{echo "\u0041"}) #" - if /mswin|mingw/ =~ RUBY_PLATFORM - assert_match(/^("?)ü\1$/, `#{EnvUtil.rubybin} -e "puts \\"\u{FC}\\""`.force_encoding("utf-8")) #" - else - assert_match(/^("?)ü\1$/, `echo "\u{FC}"`.force_encoding("utf-8")) #" - end + assert_match(/^("?)ü\1$/, + `#{EnvUtil.rubybin} -e "#coding:utf-8\nputs \\"\u{FC}\\""`.force_encoding("utf-8")) #" # \u in quoted symbols assert_equal(:A, :"\u0041")