TestParseTree

Public Instance Methods

setup() click to toggle source
      # File test/test_parse_tree.rb, line 2536
2536:   def setup
2537:     super
2538:     @processor = ParseTree.new(false)
2539:   end
test_process_string() click to toggle source
      # File test/test_parse_tree.rb, line 2541
2541:   def test_process_string
2542:     actual   = @processor.process '1 + nil'
2543:     expected = s(:call, s(:lit, 1), :+, s(:arglist, s(:nil)))
2544: 
2545:     assert_equal expected, actual
2546: 
2547:     actual   = @processor.process 'puts 42'
2548:     expected = s(:call, nil, :puts, s(:arglist, s(:lit, 42)))
2549: 
2550:     assert_equal expected, actual
2551:   end
test_process_string_newlines() click to toggle source
      # File test/test_parse_tree.rb, line 2553
2553:   def test_process_string_newlines
2554:     @processor = ParseTree.new(true)
2555:     actual   = @processor.process "1 +\n nil", false, 'test.rb', 5
2556:     expected = s(:newline, 6, "test.rb",
2557:                  s(:call, s(:lit, 1), :+, s(:arglist, s(:nil))))
2558: 
2559:     assert_equal expected, actual
2560:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.