mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
[ruby/prism] Various cleanup for initializers and typechecks
86cf82794a
This commit is contained in:
parent
2bf9ae3fa1
commit
aa473489a2
8 changed files with 66 additions and 38 deletions
|
@ -18,6 +18,12 @@ module Prism
|
|||
]
|
||||
end
|
||||
|
||||
if RUBY_VERSION < "3.4"
|
||||
filepaths -= [
|
||||
"it_with_ordinary_parameter.txt"
|
||||
]
|
||||
end
|
||||
|
||||
filepaths.each do |filepath|
|
||||
define_method(:"test_#{File.basename(filepath, ".txt")}") do
|
||||
assert_errors(File.join(base, filepath))
|
||||
|
@ -77,7 +83,7 @@ module Prism
|
|||
private
|
||||
|
||||
def assert_errors(filepath)
|
||||
expected = File.read(filepath)
|
||||
expected = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8)
|
||||
|
||||
source = expected.lines.grep_v(/^\s*\^/).join.gsub(/\n*\z/, "")
|
||||
refute_valid_syntax(source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue