From cad83fa3c4491153df0561b06bb261e25a831d0f Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 20 Aug 2021 16:18:36 +0900 Subject: ast.c: Rename "save_script_lines" to "keep_script_lines" ... as per ko1's preference. He is preparing to extend this feature to ISeq for his new debugger. He prefers "keep" to "save" for this wording. This API is internal and not included in any released version, so I change it in advance. --- test/ruby/test_ast.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 3b4cbc7dee..3af67b1495 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -393,8 +393,8 @@ class TestAst < Test::Unit::TestCase assert_equal(:a, args.children[rest]) end - def test_save_script_lines_for_parse - node = RubyVM::AbstractSyntaxTree.parse(<<~END, save_script_lines: true) + def test_keep_script_lines_for_parse + node = RubyVM::AbstractSyntaxTree.parse(<<~END, keep_script_lines: true) 1.times do 2.times do end @@ -432,14 +432,14 @@ dummy assert_equal(expected, node.children.last.children.last.children.last.source) end - def test_save_script_lines_for_of + def test_keep_script_lines_for_of proc = Proc.new { 1 + 2 } method = self.method(__method__) - node_proc = RubyVM::AbstractSyntaxTree.of(proc, save_script_lines: true) - node_method = RubyVM::AbstractSyntaxTree.of(method, save_script_lines: true) + node_proc = RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: true) + node_method = RubyVM::AbstractSyntaxTree.of(method, keep_script_lines: true) assert_equal("{ 1 + 2 }", node_proc.source) - assert_equal("def test_save_script_lines_for_of\n", node_method.source.lines.first) + assert_equal("def test_keep_script_lines_for_of\n", node_method.source.lines.first) end end -- cgit v1.2.3