summaryrefslogtreecommitdiff
path: root/spec/ruby/core/range/inspect_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-12-27 17:35:32 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-12-27 17:35:32 +0100
commit727c97da1977544c91b9b3677811da3a44af7d53 (patch)
tree4f027117edad10789db57ff4b83242753a89e39d /spec/ruby/core/range/inspect_spec.rb
parent267bed0cd91711e2a8c79219e97431ba22137b01 (diff)
Update to ruby/spec@4ce9f41
Diffstat (limited to 'spec/ruby/core/range/inspect_spec.rb')
-rw-r--r--spec/ruby/core/range/inspect_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/range/inspect_spec.rb b/spec/ruby/core/range/inspect_spec.rb
index d1072531e9..6a206a0355 100644
--- a/spec/ruby/core/range/inspect_spec.rb
+++ b/spec/ruby/core/range/inspect_spec.rb
@@ -19,6 +19,18 @@ describe "Range#inspect" do
end
end
+ ruby_version_is '2.7' do
+ it "works for beginless ranges" do
+ eval("(..1)").inspect.should == "..1"
+ eval("(...0.1)").inspect.should == "...0.1"
+ end
+
+ it "works for nil ... nil ranges" do
+ eval("(..nil)").inspect.should == "nil..nil"
+ eval("(nil...)").inspect.should == "nil...nil"
+ end
+ end
+
ruby_version_is ''...'2.7' do
it "returns a tainted string if either end is tainted" do
(("a".taint)..."c").inspect.tainted?.should be_true