summaryrefslogtreecommitdiffhomepage
path: root/test/t/string.rb
diff options
context:
space:
mode:
authorh2so5 <[email protected]>2014-12-17 14:01:39 +0900
committerh2so5 <[email protected]>2014-12-17 14:01:39 +0900
commit05b00a14c5081ee4bf362b12839dcbb94df1169a (patch)
treec5bd63ebe420a615bc003058a917bf70f553f866 /test/t/string.rb
parent5b203ead1e5f642af7bbb2c1b4d28cf4c5737633 (diff)
downloadmruby-05b00a14c5081ee4bf362b12839dcbb94df1169a.tar.gz
mruby-05b00a14c5081ee4bf362b12839dcbb94df1169a.zip
String#[] should reject nil index
Diffstat (limited to 'test/t/string.rb')
-rw-r--r--test/t/string.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/t/string.rb b/test/t/string.rb
index a56862fe2..63e4af000 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -72,6 +72,10 @@ assert('String#[]', '15.2.10.5.6') do
assert_equal 'bc', e1
assert_equal 'bc', a3
assert_nil b3
+
+ assert_raise(TypeError) do
+ a[nil]
+ end
end
assert('String#[] with Range') do