mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00
Sync to prism rename commits
This commit is contained in:
parent
8ab56869a6
commit
4f73a7c2f7
99 changed files with 7870 additions and 7877 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue