summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-05-23 00:45:30 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-05-23 00:48:32 +0900
commit9d39eb6b40966deeeaa23c28f0be640c56545644 (patch)
tree4aebc6cbc8dc22a196656c1cffb840c6f15c032d /test/ruby
parentd9b338a53f520b2dbb05555f18b8de8072300f40 (diff)
range.c (inspect_range): omit beginless "nil"
except the special case `(nil..nil)`. ``` (1..).inspect #=> "1.." (..5).inspect #=> "..5" (nil..nil).inspect #=> "nil..nil" ``` [Bug #15745]
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_range.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 5d21d30257..14fd136aa6 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -489,6 +489,10 @@ class TestRange < Test::Unit::TestCase
assert_equal("0...1", (0...1).inspect)
assert_equal("0..", (0..nil).inspect)
assert_equal("0...", (0...nil).inspect)
+ assert_equal("..1", (nil..1).inspect)
+ assert_equal("...1", (nil...1).inspect)
+ assert_equal("nil..nil", (nil..nil).inspect)
+ assert_equal("nil...nil", (nil...nil).inspect)
bug11767 = '[ruby-core:71811] [Bug #11767]'
assert_predicate(("0".taint.."1").inspect, :tainted?, bug11767)