Skip to content
This repository
tree: cd61cb9c3b
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 20 lines (18 sloc) 0.591 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require "helper"

class LabelTest < Johnson::NodeTestCase
  def test_label_statement_to_sexp
    assert_sexp([[:label,
                  [:name, "foo"], [:var, [[:assign, [:name, "x"], [:lit, 10]]]]
                ]],
                @parser.parse('foo: var x = 10;')
               )
    assert_sexp([[:label,
                  [:name, "foo"], [:var, [[:assign, [:name, "x"], [:lit, 10]]]]
                ]],
                @parser.parse('foo: var x = 10')
               )
    assert_ecma('foo: var x = 10;',
                @parser.parse('foo: var x = 10;')
               )
  end
end
Something went wrong with that request. Please try again.