diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-05 09:07:48 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-05 09:07:48 +0000 |
commit | 7eafeaa31328b4074761f4b33dc2b89946fb0617 (patch) | |
tree | 47318298a3acaaa575ed505e5b37d56b736a5230 /test | |
parent | dffae9a1f978d5ee5130475f4ea725865ead1730 (diff) | |
download | ruby-7eafeaa31328b4074761f4b33dc2b89946fb0617.tar.gz |
* string.c (fstring_cmp): take string encoding into account when
comparing fstrings [ruby-core:57037] [Bug #8866]
* test/ruby/test_string.rb: add test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 1387feccf5..4520464105 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2249,6 +2249,13 @@ class TestString < Test::Unit::TestCase b = "hello"f assert_equal a.object_id, b.object_id end + + def test_frozen_strings_are_deduplicated_with_encoding + a = eval("# coding: utf-8\n'hello'f") + b = eval("# coding: ascii\n'hello'f") + assert_equal Encoding::UTF_8, a.encoding + assert_equal Encoding::US_ASCII, b.encoding + end end class TestString2 < TestString |