Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/prism/ruby/location_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ def test_join
assert_equal 0, joined.start_offset
assert_equal 10, joined.length

assert_raise(RuntimeError, "Incompatible locations") do
e = assert_raise(RuntimeError) do
argument.location.join(receiver.location)
end
assert_equal "Incompatible locations", e.message

other_argument = Prism.parse_statement("1234 + 567").arguments.arguments.first

assert_raise(RuntimeError, "Incompatible sources") do
e = assert_raise(RuntimeError) do
other_argument.location.join(receiver.location)
end
assert_equal "Incompatible sources", e.message

assert_raise(RuntimeError, "Incompatible sources") do
e = assert_raise(RuntimeError) do
receiver.location.join(other_argument.location)
end
assert_equal "Incompatible sources", e.message
end

def test_character_offsets
Expand Down