diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-22 17:10:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-22 17:10:00 +0000 |
commit | 0d2c2bdcc13b565b3acecfc906e7d8ed7df693a2 (patch) | |
tree | 1685c7f9a014271bcaa5fff7bbf2c2782aae33bc /test/ruby | |
parent | 6fdda02efae859b6ddef9568315f34e65fdec789 (diff) | |
download | ruby-0d2c2bdcc13b565b3acecfc906e7d8ed7df693a2.tar.gz |
string.c: $; name in error message
* string.c (rb_str_split_m): show $; name in error message when it
is a wrong object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 790fa21536..e5aa2251a7 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1365,7 +1365,7 @@ CODE end def test_split - assert_nil($;) + fs, $; = $;, nil assert_equal([S("a"), S("b"), S("c")], S(" a b\t c ").split) assert_equal([S("a"), S("b"), S("c")], S(" a b\t c ").split(S(" "))) @@ -1389,6 +1389,13 @@ CODE assert_equal([], "".split(//, 1)) assert_equal("[2, 3]", [1,2,3].slice!(1,10000).inspect, "moved from btest/knownbug") + + $; = [] + assert_raise_with_message(TypeError, /\$;/) { + "".split + } + ensure + $; = fs end def test_split_encoding |