summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-03-23 08:51:14 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-03-23 08:51:25 +0900
commit4c1ce0f61cfc8988fa50dd48bb404f01d234eb7b (patch)
tree97a2ae0c6c03aa8a8fed88a745462bbfc8dd2ae7 /test
parent21a3ae08f7dc252e4cf6d34e5ebead0124fb0117 (diff)
downloadmruby-4c1ce0f61cfc8988fa50dd48bb404f01d234eb7b.tar.gz
mruby-4c1ce0f61cfc8988fa50dd48bb404f01d234eb7b.zip
add safe-navigation operator tests
Diffstat (limited to 'test')
-rw-r--r--test/t/nil.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/t/nil.rb b/test/t/nil.rb
index 53b922f9a..27f70ad8c 100644
--- a/test/t/nil.rb
+++ b/test/t/nil.rb
@@ -32,3 +32,8 @@ end
assert('NilClass#to_s', '15.2.4.3.5') do
assert_equal '', nil.to_s
end
+
+assert('safe navigation', '15.2.4.3.5') do
+ assert_nil nil&.size
+ assert_equal 0, []&.size
+end