summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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