ruby-changes:56091
From: Nobuyoshi <ko1@a...>
Date: Wed, 12 Jun 2019 10:33:49 +0900 (JST)
Subject: [ruby-changes:56091] Nobuyoshi Nakada: 0971cab4d0 (trunk): Test to disable ASCII-only optimization
https://git.ruby-lang.org/ruby.git/commit/?id=0971cab4d0 From 0971cab4d0cb730292461d16ac72c430aa23cc10 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 17 May 2019 09:53:47 +0900 Subject: Test to disable ASCII-only optimization Examples why ASCII-only optimization cannot apply multi-byte encodings which have 7-bit trailing bytes. Suggested by @duerst at https://github.com/ruby/ruby/pull/2187#issuecomment-492949218 diff --git a/test/ruby/enc/test_case_mapping.rb b/test/ruby/enc/test_case_mapping.rb index aa20531..31acdc4 100644 --- a/test/ruby/enc/test_case_mapping.rb +++ b/test/ruby/enc/test_case_mapping.rb @@ -210,6 +210,16 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_mapping.rb#L210 assert_equal "\u10D0\u10D1\u10D2", "\u10D0\u10D1\u10D2".capitalize end + def test_shift_jis_downcase_ascii + s = ("A".."Z").map {|c| "\x89#{c}"}.join("").force_encoding("Shift_JIS") + assert_equal s, s.downcase(:ascii) + end + + def test_shift_jis_upcase_ascii + s = ("a".."z").map {|c| "\x89#{c}"}.join("").force_encoding("Shift_JIS") + assert_equal s, s.upcase(:ascii) + end + def no_longer_a_test_buffer_allocations assert_equal 'TURKISH*脹'*10, ('I'*10).downcase(:turkic) assert_equal 'TURKISH*脹'*100, ('I'*100).downcase(:turkic) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/