Skip to content

Commit

Permalink
[PRISM] Enable TestISeq#test_syntax_error_message
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed May 16, 2024
1 parent 0b4cf46 commit 012a80d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 0 additions & 2 deletions test/.excludes-prism/TestISeq.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
exclude(:test_syntax_error_message, "error message format")

exclude(:test_each_child, "https://bugs.ruby-lang.org/issues/20479")
exclude(:test_trace_points, "https://bugs.ruby-lang.org/issues/20479")
16 changes: 11 additions & 5 deletions test/ruby/test_iseq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,17 @@ def y@;end
end
end
assert_equal([m1, e1.message], [m2, e2.message], feature11951)
message = e1.message.each_line
message.with_index(1) do |line, i|
next if /^ / =~ line
assert_send([line, :start_with?, __FILE__],
proc {message.map {|l, j| (i == j ? ">" : " ") + l}.join("")})

if e1.message.lines[0] == "#{__FILE__}:#{line}: syntax errors found\n"
# Prism lays out the error messages in line with the source, so the
# following assertions do not make sense in that context.
else
message = e1.message.each_line
message.with_index(1) do |line, i|
next if /^ / =~ line
assert_send([line, :start_with?, __FILE__],
proc {message.map {|l, j| (i == j ? ">" : " ") + l}.join("")})
end
end
end

Expand Down

0 comments on commit 012a80d

Please sign in to comment.