Sync to prism rename commits

This commit is contained in:
Kevin Newton 2023-09-27 12:24:48 -04:00
parent 8ab56869a6
commit 4f73a7c2f7
99 changed files with 7870 additions and 7877 deletions

View file

@ -2,19 +2,19 @@
require_relative "test_helper"
module YARP
module Prism
class RubyAPITest < TestCase
def test_ruby_api
filepath = __FILE__
source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8)
assert_equal YARP.lex(source, filepath).value, YARP.lex_file(filepath).value
assert_equal YARP.dump(source, filepath), YARP.dump_file(filepath)
assert_equal Prism.lex(source, filepath).value, Prism.lex_file(filepath).value
assert_equal Prism.dump(source, filepath), Prism.dump_file(filepath)
serialized = YARP.dump(source, filepath)
ast1 = YARP.load(source, serialized).value
ast2 = YARP.parse(source, filepath).value
ast3 = YARP.parse_file(filepath).value
serialized = Prism.dump(source, filepath)
ast1 = Prism.load(source, serialized).value
ast2 = Prism.parse(source, filepath).value
ast3 = Prism.parse_file(filepath).value
assert_equal_nodes ast1, ast2
assert_equal_nodes ast2, ast3
@ -58,7 +58,7 @@ module YARP
private
def parse_expression(source)
YARP.parse(source).value.statements.body.first
Prism.parse(source).value.statements.body.first
end
end
end