diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-05 12:44:55 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-05 12:44:55 +0000 |
commit | 87c7129e6fb1056f7a575e8223ecd313f4224b97 (patch) | |
tree | 9f9f998a8395adae1819983ca07e7eceeffa954e /test/ruby/test_string.rb | |
parent | 22341c402e1d033aaf279413677e3063c7012082 (diff) | |
download | ruby-87c7129e6fb1056f7a575e8223ecd313f4224b97.tar.gz |
* test/ruby/test_string.rb(test_chr): added test for String#chr
[fix GH-1179]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-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 72fca75b29..0120bff9bd 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2349,6 +2349,13 @@ class TestString < Test::Unit::TestCase assert_equal(0x3042, "\u3042\u3043".ord) assert_raise(ArgumentError) { "".ord } end + + def test_chr + assert_equal("a", "abcde".chr) + assert_equal("a", "a".chr) + assert_equal("\u3042", "\u3042\u3043".chr) + assert_equal('', ''.chr) + end end class TestString2 < TestString |