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
13 changes: 6 additions & 7 deletions test/prism/ruby/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,14 @@ def assert_equal_asts_message(expected_ast, actual_ast)

def assert_equal_tokens(expected_tokens, actual_tokens)
if expected_tokens != actual_tokens
expected_index = 0
actual_index = 0
index = 0
max_index = [expected_tokens, actual_tokens].map(&:size).max

while expected_index < expected_tokens.length
expected_token = expected_tokens[expected_index]
actual_token = actual_tokens.fetch(actual_index, [])
while index <= max_index
expected_token = expected_tokens.fetch(index, [])
actual_token = actual_tokens.fetch(index, [])

expected_index += 1
actual_index += 1
index += 1

# There are a lot of tokens that have very specific meaning according
# to the context of the parser. We don't expose that information in
Expand Down
Loading