diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-11-14 17:32:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-14 17:32:35 -0500 |
commit | f6a16106fa124defcdf748514264098178173e83 (patch) | |
tree | 5a3928e07bccf1a97c775691541385fb2a48c7da | |
parent | f9ba12bd5382dc3251debce81f0c82566aee7581 (diff) | |
parent | c30f664c71708391a16183c13fcfd0a0d52ffa6c (diff) | |
download | rails-f6a16106fa124defcdf748514264098178173e83.tar.gz rails-f6a16106fa124defcdf748514264098178173e83.tar.bz2 rails-f6a16106fa124defcdf748514264098178173e83.zip |
Merge pull request #34450 from mtsmfm/add-test
Add test for normalizing non-unicode string
-rw-r--r-- | activesupport/test/multibyte_chars_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index f87099566b..5f4e3f3fd3 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -772,6 +772,16 @@ class MultibyteCharsExtrasTest < ActiveSupport::TestCase assert_deprecated { ActiveSupport::Multibyte::Unicode.swapcase("") } end + def test_normalize_non_unicode_string + # Fullwidth Latin Capital Letter A in Windows 31J + str = "\u{ff21}".encode(Encoding::Windows_31J) + assert_raise Encoding::CompatibilityError do + ActiveSupport::Deprecation.silence do + ActiveSupport::Multibyte::Unicode.normalize(str) + end + end + end + private def string_from_classes(classes) |