Sha256: b002fff18a4c9c258f7a47f5e76e5584f46bae5d3d0621cec7ab437f13f95beb

Contents?: true

Size: 723 Bytes

Versions: 12

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

require 'helper'

class TestASTProcessor < Minitest::Test
  LEAF_NODES = %i[
    sym str int float complex rational
    true false nil self
    __FILE__ __LINE__ __ENCODING__
    cbase regopt zsuper
    match_with_trailing_comma match_nil_pattern
    forward_args forwarded_args numargs kwnilarg
    objc_varargs objc_restarg objc_kwarg
    ident
  ].freeze

  def setup
    @traversible = Parser::AST::Processor
      .instance_methods(false)
      .map { |mid| mid.to_s.scan(/\Aon_(.*)/) }
      .flatten
      .map(&:to_sym)

    @traversible += LEAF_NODES
  end

  def test_nodes_are_traversible
    for_each_node do |node|
      assert_includes @traversible, node.type
    end
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
passbase-1.3.0 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.2.0 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.1.0 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.0.3 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.0.2 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.0.1 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
passbase-1.0.0 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
parser-2.7.1.5 test/test_ast_processor.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/parser-2.7.1.4/test/test_ast_processor.rb
parser-2.7.1.4 test/test_ast_processor.rb
parser-2.7.1.3 test/test_ast_processor.rb