aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2023-08-02 21:22:20 +0200
committerTakashi Kokubun <takashikkbn@gmail.com>2023-08-16 17:47:32 -0700
commit1002b777c4d8c7036759a2cd28f3fea5352f98d6 (patch)
treeb390d96f8caa47588179bf9bbcea00c83d01ef13 /test
parent820a58c228b8dbd29915065f8e5f18a61442bb88 (diff)
downloadruby-1002b777c4d8c7036759a2cd28f3fea5352f98d6.tar.gz
[ruby/yarp] Automatically find the right line for yarp/serialize.rb newline test
https://github.com/ruby/yarp/commit/5908130541
Diffstat (limited to 'test')
-rw-r--r--test/newline_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/newline_test.rb b/test/newline_test.rb
index 5a81f52637..1f6b550f30 100644
--- a/test/newline_test.rb
+++ b/test/newline_test.rb
@@ -35,7 +35,8 @@ class NewlineTest < Test::Unit::TestCase
if relative == "lib/yarp/serialize.rb"
# while (b = io.getbyte) >= 128 has 2 newline flags
- expected.delete_at actual.index(62)
+ line_number = source.lines.index { |line| line.include?('while (b = io.getbyte) >= 128') } + 1
+ expected.delete_at(expected.index(line_number))
elsif relative == "lib/yarp/lex_compat.rb"
# extra flag for: dedent_next =\n ((token.event: due to bytecode order
actual.delete(520)