summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2023-12-20 17:55:50 -0800
committergit <svn-admin@ruby-lang.org>2024-01-15 14:04:14 +0000
commite0312f90bbf5a6c0af5140ea94c67911515a147b (patch)
treeae31965ba00b473b6617950471ce71fbe7feb01f /test
parent9c3299896e7ea0aa1d9cc0d4786d7be2908ca9be (diff)
[ruby/pp] Print beginless ranges properly
Instead of displaying the start of the range as nil https://github.com/ruby/pp/commit/1df210d903
Diffstat (limited to 'test')
-rw-r--r--test/test_pp.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_pp.rb b/test/test_pp.rb
index 6da2b808b9..26e730fd00 100644
--- a/test/test_pp.rb
+++ b/test/test_pp.rb
@@ -28,6 +28,13 @@ class PPTest < Test::Unit::TestCase
end
assert_equal(%(""\n), PP.pp(o, "".dup))
end
+
+ def test_range
+ assert_equal("0..1\n", PP.pp(0..1, "".dup))
+ assert_equal("0...1\n", PP.pp(0...1, "".dup))
+ assert_equal("0...\n", PP.pp(0..., "".dup))
+ assert_equal("...1\n", PP.pp(...1, "".dup))
+ end
end
class HasInspect