File tree Expand file tree Collapse file tree 4 files changed +22
-51
lines changed
ruby/core/thread/backtrace/location
truffle/thread/backtrace/location Expand file tree Collapse file tree 4 files changed +22
-51
lines changed Original file line number Diff line number Diff line change 10
10
it 'returns the absolute path of the call frame' do
11
11
@frame . lineno . should == @line
12
12
end
13
+
14
+ it 'should be the same line number as in #to_s, including for core methods' do
15
+ # Get the caller_locations from a call made into a core library method
16
+ locations = [ :non_empty ] . map { caller_locations } [ 0 ]
17
+
18
+ locations . each do |location |
19
+ line_number = location . to_s [ /:(\d +):/ , 1 ]
20
+ location . lineno . should == Integer ( line_number )
21
+ end
22
+ end
13
23
end
Original file line number Diff line number Diff line change 87
87
end
88
88
end
89
89
90
+ it 'should be the same path as in #to_s, including for core methods' do
91
+ # Get the caller_locations from a call made into a core library method
92
+ locations = [ :non_empty ] . map { caller_locations } [ 0 ]
93
+
94
+ locations . each do |location |
95
+ filename = location . to_s [ /^(.+):\d +:/ , 1 ]
96
+ path = location . path
97
+
98
+ path . should == filename
99
+ end
100
+ end
101
+
90
102
context "canonicalization" do
91
103
platform_is_not :windows do
92
104
before :each do
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments