summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndy Waite <andyw8@users.noreply.github.com>2023-08-29 16:42:43 -0400
committergit <svn-admin@ruby-lang.org>2023-09-06 18:37:41 +0000
commitfdf7aad902ccc9e2f32e4b6b3e21fb68a8788d16 (patch)
treecad230e27e923e4ccf9ca3a401e5e01237fda7c2 /test
parent12102d101af258d7a3e9695b736a189cd3658df1 (diff)
[ruby/yarp] Fix `Location#end_column`
https://github.com/ruby/yarp/commit/00e4711026
Diffstat (limited to 'test')
-rw-r--r--test/yarp/location_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/yarp/location_test.rb b/test/yarp/location_test.rb
index 4509fc0cf5..d86afb0b3b 100644
--- a/test/yarp/location_test.rb
+++ b/test/yarp/location_test.rb
@@ -817,6 +817,14 @@ module YARP
node = result.value.statements.body.last
node = yield node if block_given?
+ if expected.begin == 0
+ assert_equal 0, node.location.start_column
+ end
+
+ if expected.end == source.length
+ assert_equal source.split("\n").last.length, node.location.end_column
+ end
+
assert_kind_of kind, node
assert_equal expected.begin, node.location.start_offset
assert_equal expected.end, node.location.end_offset