diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-09-26 14:23:52 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-26 18:23:59 +0000 |
commit | 705bd6439de07db1502d2fc3ac6e13ae449fc12e (patch) | |
tree | 6cedded93ac7aff2e95740921644074cb3ac2abe | |
parent | a436805d3b3b82b34bc60c07763b31da2aba95b9 (diff) | |
download | ruby-705bd6439de07db1502d2fc3ac6e13ae449fc12e.tar.gz |
[ruby/yarp] Ensure newlines are sorted in newline test
https://github.com/ruby/yarp/commit/3bfefc44c4
-rw-r--r-- | test/yarp/newline_test.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/test/yarp/newline_test.rb b/test/yarp/newline_test.rb index 7fb6d173bb..7bf79d46e5 100644 --- a/test/yarp/newline_test.rb +++ b/test/yarp/newline_test.rb @@ -6,20 +6,6 @@ return unless defined?(RubyVM::InstructionSequence) module YARP class NewlineTest < TestCase - class NewlineVisitor < Visitor - attr_reader :source, :newlines - - def initialize(source) - @source = source - @newlines = [] - end - - def visit(node) - newlines << source.line(node.location.start_offset) if node&.newline? - super(node) - end - end - base = File.dirname(__dir__) Dir["{lib,test}/**/*.rb", base: base].each do |relative| define_method("test_newline_flags_#{relative}") do @@ -99,7 +85,7 @@ module YARP newlines << result.source.line(node.location.start_offset) if node&.newline? end - newlines + newlines.sort end end end |