From eaad44adb2043f0b597196fd44cfaae8db3a3b18 Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Tue, 27 Jun 2023 19:18:58 +0900 Subject: [PATCH] [ruby/irb] Always add \n at the end of the test input in RubyLex test (https://github.com/ruby/irb/pull/614) https://github.com/ruby/irb/commit/e68c6128aa --- test/irb/test_ruby_lex.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index 6bab52f3de1ade..c90abdd5e6af39 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -101,7 +101,7 @@ def assert_code_block_open(lines, expected, local_variables: []) def check_state(lines, local_variables: []) context = build_context(local_variables) - code = lines.join("\n") + code = lines.map { |l| "#{l}\n" }.join # code should end with "\n" tokens = RubyLex.ripper_lex_without_warning(code, context: context) opens = IRB::NestingParser.open_tokens(tokens) ruby_lex = RubyLex.new(context) @@ -791,7 +791,7 @@ def test_should_continue assert_should_continue(['a;'], false) assert_should_continue(['<