From: Eric Hodel Date: 2012-07-24T09:30:55+09:00 Subject: Re: [ruby-cvs:43685] luislavena:r36509 (trunk): Fix raw UTF-8 test for non-Japanase Windows systems --Apple-Mail=_B0C4482D-1D30-4C56-8463-24AE13282428 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On Jul 23, 2012, at 16:32, luislavena@ruby-lang.org wrote: > luislavena 2012-07-24 08:32:29 +0900 (Tue, 24 Jul 2012) >=20 > New Revision: 36509 >=20 > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=3Drev&revision=3D36509= >=20 > Log: > Fix raw UTF-8 test for non-Japanase Windows systems >=20 > * test/ruby/test_dir_m17n.rb (create_and_check_raw_file_name): add = new > helper method to ease encoding testing. Patch by Oleg = Sukhodolsky. > [ruby-core:46589][Bug #6765] >=20 > * test/ruby/test_dir_m17n.rb (test_filename_extutf8): use = filesystem > encoding when reading entries and comparing. >=20 > * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_name): = removed. >=20 > * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_jp_name): = split test. >=20 > Modified files: > trunk/ChangeLog > trunk/test/ruby/test_dir_m17n.rb This change causes a failure on OS X 10.7.4: [12/13] TestDir_M17N#test_filename_utf8_raw_windows_1252_name =3D 0.02 s = =20 1) Failure: test_filename_utf8_raw_windows_1252_name(TestDir_M17N) = [/Users/drbrain/Work/svn/ruby/trunk/test/ruby/test_dir_m17n.rb:23]: character 199 in UTF-8 (#) When I run the script by hand I get a filename of "=C7" (That's U+0043 = latin capital letter C, U+0327 combining cedilla). I'm unsure what the = expected result is. PS: I changed the assertions slightly to be more informative about = failures: --Apple-Mail=_B0C4482D-1D30-4C56-8463-24AE13282428 Content-Disposition: attachment; filename=test_ruby_m17n.assertion_message.patch Content-Type: application/octet-stream; name="test_ruby_m17n.assertion_message.patch" Content-Transfer-Encoding: 7bit Index: test/ruby/test_dir_m17n.rb =================================================================== --- test/ruby/test_dir_m17n.rb (revision 36509) +++ test/ruby/test_dir_m17n.rb (working copy) @@ -20,7 +20,8 @@ class TestDir_M17N < Test::Unit::TestCas ents = Dir.entries(".", opts) exit ents.include?(filename) ] - assert_ruby_status(["-E#{encoding}"], create_file_program, nil, :chdir=>dir) + assert_ruby_status(["-E#{encoding}"], create_file_program, + "character #{code} in #{encoding}", chdir: dir) test_file_program = %Q[ filename = #{code}.chr('UTF-8').force_encoding("ASCII-8BIT") @@ -34,7 +35,8 @@ class TestDir_M17N < Test::Unit::TestCas end exit result ] - assert_ruby_status(%w[-EASCII-8BIT], test_file_program, nil, :chdir=>dir) + assert_ruby_status(%w[-EASCII-8BIT], test_file_program, + "character #{code} in ASCII-8BIT", chdir: dir) } end --Apple-Mail=_B0C4482D-1D30-4C56-8463-24AE13282428 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_B0C4482D-1D30-4C56-8463-24AE13282428--