summaryrefslogtreecommitdiff
path: root/spec/ruby/core/thread/backtrace/location/lineno_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-07-27 21:41:08 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-07-27 21:41:08 +0200
commit126fd5f15cff0d3bf314d90d8c21a3ae25ae8e68 (patch)
tree33350f7170436c32ed4c8e79f0be2c334c7bc8a9 /spec/ruby/core/thread/backtrace/location/lineno_spec.rb
parent7429841ab6494b849106e6d3b119f147adfee3b7 (diff)
downloadruby-126fd5f15cff0d3bf314d90d8c21a3ae25ae8e68.tar.gz
Update to ruby/spec@07164da
Diffstat (limited to 'spec/ruby/core/thread/backtrace/location/lineno_spec.rb')
-rw-r--r--spec/ruby/core/thread/backtrace/location/lineno_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/backtrace/location/lineno_spec.rb b/spec/ruby/core/thread/backtrace/location/lineno_spec.rb
index dc93d32d75..d14cf17514 100644
--- a/spec/ruby/core/thread/backtrace/location/lineno_spec.rb
+++ b/spec/ruby/core/thread/backtrace/location/lineno_spec.rb
@@ -10,4 +10,14 @@ describe 'Thread::Backtrace::Location#lineno' do
it 'returns the absolute path of the call frame' do
@frame.lineno.should == @line
end
+
+ it 'should be the same line number as in #to_s, including for core methods' do
+ # Get the caller_locations from a call made into a core library method
+ locations = [:non_empty].map { caller_locations }[0]
+
+ locations.each do |location|
+ line_number = location.to_s[/:(\d+):/, 1]
+ location.lineno.should == Integer(line_number)
+ end
+ end
end